Remove curly brace offset syntax

This commit is contained in:
2025-04-20 22:42:20 -07:00
parent 1dac9cc3df
commit 7f805eccc8
5 changed files with 60 additions and 60 deletions

View File

@@ -1944,7 +1944,7 @@ function PMA_flipstring($string, $Separator = "<br />\n")
$charbuff = false; $charbuff = false;
for ($i = 0, $str_len = strlen($string); $i < $str_len; $i++) { for ($i = 0, $str_len = strlen($string); $i < $str_len; $i++) {
$char = $string{$i}; $char = $string[$i];
$append = false; $append = false;
if ($char == '&') { if ($char == '&') {

View File

@@ -769,7 +769,7 @@ if (! defined('PMA_MINIMUM_COMMON')) {
} }
} elseif (PMA_STR_binarySearchInArr($d_cur, $mysql_charsets, $mysql_charsets_count) } elseif (PMA_STR_binarySearchInArr($d_cur, $mysql_charsets, $mysql_charsets_count)
|| PMA_STR_binarySearchInArr($d_cur, $mysql_collations_flat, $mysql_collations_count) || PMA_STR_binarySearchInArr($d_cur, $mysql_collations_flat, $mysql_collations_count)
|| ($d_cur{0} == '_' && PMA_STR_binarySearchInArr(substr($d_cur, 1), $mysql_charsets, $mysql_charsets_count))) { || ($d_cur[0] == '_' && PMA_STR_binarySearchInArr(substr($d_cur, 1), $mysql_charsets, $mysql_charsets_count))) {
$t_suffix = '_charset'; $t_suffix = '_charset';
} else { } else {
// Do nothing // Do nothing

View File

@@ -76,7 +76,7 @@
// dullus for text Justification. // dullus for text Justification.
// Bob Vincent (pillarsdotnet@users.sourceforge.net) for <li> value attribute. // Bob Vincent (pillarsdotnet@users.sourceforge.net) for <li> value attribute.
// Patrick Benny for text stretch suggestion on Cell(). // Patrick Benny for text stretch suggestion on Cell().
// Johannes Güntert for JavaScript support. // Johannes G<EFBFBD>ntert for JavaScript support.
// Denis Van Nuffelen for Dynamic Form. // Denis Van Nuffelen for Dynamic Form.
// Jacek Czekaj for multibyte justification // Jacek Czekaj for multibyte justification
// Anthony Ferrara for the reintroduction of legacy image methods. // Anthony Ferrara for the reintroduction of legacy image methods.
@@ -87,7 +87,7 @@
// Mohamad Ali Golkar, Saleh AlMatrafe, Charles Abbott for Arabic and Persian support. // Mohamad Ali Golkar, Saleh AlMatrafe, Charles Abbott for Arabic and Persian support.
// Moritz Wagner and Andreas Wurmser for graphic functions. // Moritz Wagner and Andreas Wurmser for graphic functions.
// Andrew Whitehead for core fonts support. // Andrew Whitehead for core fonts support.
// Esteban Joël Marín for OpenType font conversion. // Esteban Jo<EFBFBD>l Mar<EFBFBD>n for OpenType font conversion.
// Teus Hagen for several suggestions and fixes. // Teus Hagen for several suggestions and fixes.
// Yukihiro Nakadaira for CID-0 CJK fonts fixes. // Yukihiro Nakadaira for CID-0 CJK fonts fixes.
// Kosmas Papachristos for some CSS improvements. // Kosmas Papachristos for some CSS improvements.
@@ -2997,7 +2997,7 @@ class TCPDF {
if (empty($orientation)) { if (empty($orientation)) {
$orientation = $default_orientation; $orientation = $default_orientation;
} else { } else {
$orientation = strtoupper($orientation{0}); $orientation = strtoupper($orientation[0]);
} }
if (in_array($orientation, $valid_orientations) AND ($orientation != $default_orientation)) { if (in_array($orientation, $valid_orientations) AND ($orientation != $default_orientation)) {
$this->CurOrientation = $orientation; $this->CurOrientation = $orientation;
@@ -6715,7 +6715,7 @@ class TCPDF {
* @param $cellpadding (float) Internal cell padding, if empty uses default cell padding. * @param $cellpadding (float) Internal cell padding, if empty uses default cell padding.
* @param $border (mixed) Indicates if borders must be drawn around the cell. The value can be a number:<ul><li>0: no border (default)</li><li>1: frame</li></ul> or a string containing some or all of the following characters (in any order):<ul><li>L: left</li><li>T: top</li><li>R: right</li><li>B: bottom</li></ul> or an array of line styles for each border group - for example: array('LTRB' => array('width' => 2, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0))) * @param $border (mixed) Indicates if borders must be drawn around the cell. The value can be a number:<ul><li>0: no border (default)</li><li>1: frame</li></ul> or a string containing some or all of the following characters (in any order):<ul><li>L: left</li><li>T: top</li><li>R: right</li><li>B: bottom</li></ul> or an array of line styles for each border group - for example: array('LTRB' => array('width' => 2, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0)))
* @return float Return the minimal height needed for multicell method for printing the $txt param. * @return float Return the minimal height needed for multicell method for printing the $txt param.
* @author Alexander Escalona Fernández, Nicola Asuni * @author Alexander Escalona Fern<EFBFBD>ndez, Nicola Asuni
* @public * @public
* @since 4.5.011 * @since 4.5.011
*/ */
@@ -6822,7 +6822,7 @@ class TCPDF {
* @param $cellpadding (float) Internal cell padding, if empty uses default cell padding. * @param $cellpadding (float) Internal cell padding, if empty uses default cell padding.
* @param $border (mixed) Indicates if borders must be drawn around the cell. The value can be a number:<ul><li>0: no border (default)</li><li>1: frame</li></ul> or a string containing some or all of the following characters (in any order):<ul><li>L: left</li><li>T: top</li><li>R: right</li><li>B: bottom</li></ul> or an array of line styles for each border group - for example: array('LTRB' => array('width' => 2, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0))) * @param $border (mixed) Indicates if borders must be drawn around the cell. The value can be a number:<ul><li>0: no border (default)</li><li>1: frame</li></ul> or a string containing some or all of the following characters (in any order):<ul><li>L: left</li><li>T: top</li><li>R: right</li><li>B: bottom</li></ul> or an array of line styles for each border group - for example: array('LTRB' => array('width' => 2, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0)))
* @return float Return the minimal height needed for multicell method for printing the $txt param. * @return float Return the minimal height needed for multicell method for printing the $txt param.
* @author Nicola Asuni, Alexander Escalona Fernández * @author Nicola Asuni, Alexander Escalona Fern<EFBFBD>ndez
* @public * @public
*/ */
public function getStringHeight($w, $txt, $reseth=false, $autopadding=true, $cellpadding='', $border=0) { public function getStringHeight($w, $txt, $reseth=false, $autopadding=true, $cellpadding='', $border=0) {
@@ -7515,7 +7515,7 @@ class TCPDF {
$cached_file = false; $cached_file = false;
} }
} else { // image file } else { // image file
if ($file{0} === '*') { if ($file[0] === '*') {
// image as external stream // image as external stream
$file = substr($file, 1); $file = substr($file, 1);
$exurl = $file; $exurl = $file;
@@ -7604,7 +7604,7 @@ class TCPDF {
// height difference // height difference
$hdiff = ($oldh - $h); $hdiff = ($oldh - $h);
// vertical alignment // vertical alignment
switch (strtoupper($fitbox{1})) { switch (strtoupper($fitbox[1])) {
case 'T': { case 'T': {
break; break;
} }
@@ -7625,7 +7625,7 @@ class TCPDF {
// width difference // width difference
$wdiff = ($oldw - $w); $wdiff = ($oldw - $w);
// horizontal alignment // horizontal alignment
switch (strtoupper($fitbox{0})) { switch (strtoupper($fitbox[0])) {
case 'L': { case 'L': {
if ($this->rtl) { if ($this->rtl) {
$x -= $wdiff; $x -= $wdiff;
@@ -7912,7 +7912,7 @@ class TCPDF {
public function set_mqr($mqr) { public function set_mqr($mqr) {
if (!defined('PHP_VERSION_ID')) { if (!defined('PHP_VERSION_ID')) {
$version = PHP_VERSION; $version = PHP_VERSION;
define('PHP_VERSION_ID', (($version{0} * 10000) + ($version{2} * 100) + $version{4})); define('PHP_VERSION_ID', (($version[0] * 10000) + ($version[2] * 100) + $version[4]));
} }
if (PHP_VERSION_ID < 50300) { if (PHP_VERSION_ID < 50300) {
@set_magic_quotes_runtime($mqr); @set_magic_quotes_runtime($mqr);
@@ -7927,7 +7927,7 @@ class TCPDF {
public function get_mqr() { public function get_mqr() {
if (!defined('PHP_VERSION_ID')) { if (!defined('PHP_VERSION_ID')) {
$version = PHP_VERSION; $version = PHP_VERSION;
define('PHP_VERSION_ID', (($version{0} * 10000) + ($version{2} * 100) + $version{4})); define('PHP_VERSION_ID', (($version[0] * 10000) + ($version[2] * 100) + $version[4]));
} }
if (PHP_VERSION_ID < 50300) { if (PHP_VERSION_ID < 50300) {
return @get_magic_quotes_runtime(); return @get_magic_quotes_runtime();
@@ -8062,7 +8062,7 @@ class TCPDF {
if (count($icc) > 0) { if (count($icc) > 0) {
ksort($icc); ksort($icc);
$icc = implode('', $icc); $icc = implode('', $icc);
if ((ord($icc{36}) != 0x61) OR (ord($icc{37}) != 0x63) OR (ord($icc{38}) != 0x73) OR (ord($icc{39}) != 0x70)) { if ((ord($icc[36]) != 0x61) OR (ord($icc[37]) != 0x63) OR (ord($icc[38]) != 0x73) OR (ord($icc[39]) != 0x70)) {
// invalid ICC profile // invalid ICC profile
$icc = false; $icc = false;
} }
@@ -8146,9 +8146,9 @@ class TCPDF {
// read transparency info // read transparency info
$t = $this->rfread($f, $n); $t = $this->rfread($f, $n);
if ($ct == 0) { if ($ct == 0) {
$trns = array(ord($t{1})); $trns = array(ord($t[1]));
} elseif ($ct == 2) { } elseif ($ct == 2) {
$trns = array(ord($t{1}), ord($t{3}), ord($t{5})); $trns = array(ord($t[1]), ord($t[3]), ord($t[5]));
} else { } else {
$pos = strpos($t, chr(0)); $pos = strpos($t, chr(0));
if ($pos !== false) { if ($pos !== false) {
@@ -8494,7 +8494,7 @@ class TCPDF {
$dest = $dest ? 'D' : 'F'; $dest = $dest ? 'D' : 'F';
} }
$dest = strtoupper($dest); $dest = strtoupper($dest);
if ($dest{0} != 'F') { if ($dest[0] != 'F') {
$name = preg_replace('/[\s]+/', '_', $name); $name = preg_replace('/[\s]+/', '_', $name);
$name = preg_replace('/[^a-zA-Z0-9_\.-]/', '', $name); $name = preg_replace('/[^a-zA-Z0-9_\.-]/', '', $name);
} }
@@ -11263,7 +11263,7 @@ class TCPDF {
$font = file_get_contents($fontfile); $font = file_get_contents($fontfile);
$compressed = (substr($file, -2) == '.z'); $compressed = (substr($file, -2) == '.z');
if ((!$compressed) AND (isset($info['length2']))) { if ((!$compressed) AND (isset($info['length2']))) {
$header = (ord($font{0}) == 128); $header = (ord($font[0]) == 128);
if ($header) { if ($header) {
// strip first binary header // strip first binary header
$font = substr($font, 6); $font = substr($font, 6);
@@ -13396,7 +13396,7 @@ class TCPDF {
* @public * @public
*/ */
public function addHtmlLink($url, $name, $fill=false, $firstline=false, $color='', $style=-1, $firstblock=false) { public function addHtmlLink($url, $name, $fill=false, $firstline=false, $color='', $style=-1, $firstblock=false) {
if (!$this->empty_string($url) AND ($url{0} == '#')) { if (!$this->empty_string($url) AND ($url[0] == '#')) {
// convert url to internal link // convert url to internal link
$lnkdata = explode(',', $url); $lnkdata = explode(',', $url);
if (isset($lnkdata[0])) { if (isset($lnkdata[0])) {
@@ -13521,7 +13521,7 @@ class TCPDF {
} }
return $returncolor; return $returncolor;
} }
if ($color{0} != '#') { if ($color[0] != '#') {
// COLOR NAME // COLOR NAME
if (isset($this->webcolor[$color])) { if (isset($this->webcolor[$color])) {
// web color // web color
@@ -14793,7 +14793,7 @@ class TCPDF {
} }
/** /**
* Append a cubic Bézier curve to the current path. The curve shall extend from the current point to the point (x3, y3), using (x1, y1) and (x2, y2) as the Bézier control points. * Append a cubic B<EFBFBD>zier curve to the current path. The curve shall extend from the current point to the point (x3, y3), using (x1, y1) and (x2, y2) as the B<EFBFBD>zier control points.
* The new current point shall be (x3, y3). * The new current point shall be (x3, y3).
* @param $x1 (float) Abscissa of control point 1. * @param $x1 (float) Abscissa of control point 1.
* @param $y1 (float) Ordinate of control point 1. * @param $y1 (float) Ordinate of control point 1.
@@ -14809,7 +14809,7 @@ class TCPDF {
} }
/** /**
* Append a cubic Bézier curve to the current path. The curve shall extend from the current point to the point (x3, y3), using the current point and (x2, y2) as the Bézier control points. * Append a cubic B<EFBFBD>zier curve to the current path. The curve shall extend from the current point to the point (x3, y3), using the current point and (x2, y2) as the B<EFBFBD>zier control points.
* The new current point shall be (x3, y3). * The new current point shall be (x3, y3).
* @param $x2 (float) Abscissa of control point 2. * @param $x2 (float) Abscissa of control point 2.
* @param $y2 (float) Ordinate of control point 2. * @param $y2 (float) Ordinate of control point 2.
@@ -14823,7 +14823,7 @@ class TCPDF {
} }
/** /**
* Append a cubic Bézier curve to the current path. The curve shall extend from the current point to the point (x3, y3), using (x1, y1) and (x3, y3) as the Bézier control points. * Append a cubic B<EFBFBD>zier curve to the current path. The curve shall extend from the current point to the point (x3, y3), using (x1, y1) and (x3, y3) as the B<EFBFBD>zier control points.
* The new current point shall be (x3, y3). * The new current point shall be (x3, y3).
* @param $x1 (float) Abscissa of control point 1. * @param $x1 (float) Abscissa of control point 1.
* @param $y1 (float) Ordinate of control point 1. * @param $y1 (float) Ordinate of control point 1.
@@ -16193,7 +16193,7 @@ class TCPDF {
/** /**
* Create a javascript PDF string. * Create a javascript PDF string.
* @protected * @protected
* @author Johannes Güntert, Nicola Asuni * @author Johannes G<EFBFBD>ntert, Nicola Asuni
* @since 5.9.098 (2011-06-23) * @since 5.9.098 (2011-06-23)
*/ */
protected function _putdests() { protected function _putdests() {
@@ -16380,7 +16380,7 @@ class TCPDF {
* Adds a javascript * Adds a javascript
* @param $script (string) Javascript code * @param $script (string) Javascript code
* @public * @public
* @author Johannes Güntert, Nicola Asuni * @author Johannes G<EFBFBD>ntert, Nicola Asuni
* @since 2.1.002 (2008-02-12) * @since 2.1.002 (2008-02-12)
*/ */
public function IncludeJS($script) { public function IncludeJS($script) {
@@ -16409,7 +16409,7 @@ class TCPDF {
/** /**
* Create a javascript PDF string. * Create a javascript PDF string.
* @protected * @protected
* @author Johannes Güntert, Nicola Asuni * @author Johannes G<EFBFBD>ntert, Nicola Asuni
* @since 2.1.002 (2008-02-12) * @since 2.1.002 (2008-02-12)
*/ */
protected function _putjavascript() { protected function _putjavascript() {
@@ -18350,7 +18350,7 @@ class TCPDF {
* @param $col1 (array) first color (Grayscale, RGB or CMYK components). * @param $col1 (array) first color (Grayscale, RGB or CMYK components).
* @param $col2 (array) second color (Grayscale, RGB or CMYK components). * @param $col2 (array) second color (Grayscale, RGB or CMYK components).
* @param $coords (array) array of the form (x1, y1, x2, y2) which defines the gradient vector (see linear_gradient_coords.jpg). The default value is from left to right (x1=0, y1=0, x2=1, y2=0). * @param $coords (array) array of the form (x1, y1, x2, y2) which defines the gradient vector (see linear_gradient_coords.jpg). The default value is from left to right (x1=0, y1=0, x2=1, y2=0).
* @author Andreas Würmser, Nicola Asuni * @author Andreas W<EFBFBD>rmser, Nicola Asuni
* @since 3.1.000 (2008-06-09) * @since 3.1.000 (2008-06-09)
* @public * @public
*/ */
@@ -18368,7 +18368,7 @@ class TCPDF {
* @param $col1 (array) first color (Grayscale, RGB or CMYK components). * @param $col1 (array) first color (Grayscale, RGB or CMYK components).
* @param $col2 (array) second color (Grayscale, RGB or CMYK components). * @param $col2 (array) second color (Grayscale, RGB or CMYK components).
* @param $coords (array) array of the form (fx, fy, cx, cy, r) where (fx, fy) is the starting point of the gradient with color1, (cx, cy) is the center of the circle with color2, and r is the radius of the circle (see radial_gradient_coords.jpg). (fx, fy) should be inside the circle, otherwise some areas will not be defined. * @param $coords (array) array of the form (fx, fy, cx, cy, r) where (fx, fy) is the starting point of the gradient with color1, (cx, cy) is the center of the circle with color2, and r is the radius of the circle (see radial_gradient_coords.jpg). (fx, fy) should be inside the circle, otherwise some areas will not be defined.
* @author Andreas Würmser, Nicola Asuni * @author Andreas W<EFBFBD>rmser, Nicola Asuni
* @since 3.1.000 (2008-06-09) * @since 3.1.000 (2008-06-09)
* @public * @public
*/ */
@@ -18391,7 +18391,7 @@ class TCPDF {
* @param $coords_min (array) minimum value used by the coordinates. If a coordinate's value is smaller than this it will be cut to coords_min. default: 0 * @param $coords_min (array) minimum value used by the coordinates. If a coordinate's value is smaller than this it will be cut to coords_min. default: 0
* @param $coords_max (array) maximum value used by the coordinates. If a coordinate's value is greater than this it will be cut to coords_max. default: 1 * @param $coords_max (array) maximum value used by the coordinates. If a coordinate's value is greater than this it will be cut to coords_max. default: 1
* @param $antialias (boolean) A flag indicating whether to filter the shading function to prevent aliasing artifacts. * @param $antialias (boolean) A flag indicating whether to filter the shading function to prevent aliasing artifacts.
* @author Andreas Würmser, Nicola Asuni * @author Andreas W<EFBFBD>rmser, Nicola Asuni
* @since 3.1.000 (2008-06-09) * @since 3.1.000 (2008-06-09)
* @public * @public
*/ */
@@ -18483,7 +18483,7 @@ class TCPDF {
* @param $y (float) ordinate of the top left corner of the rectangle. * @param $y (float) ordinate of the top left corner of the rectangle.
* @param $w (float) width of the rectangle. * @param $w (float) width of the rectangle.
* @param $h (float) height of the rectangle. * @param $h (float) height of the rectangle.
* @author Andreas Würmser, Nicola Asuni * @author Andreas W<EFBFBD>rmser, Nicola Asuni
* @since 3.1.000 (2008-06-09) * @since 3.1.000 (2008-06-09)
* @protected * @protected
*/ */
@@ -18884,7 +18884,7 @@ class TCPDF {
// check page for no-write regions and adapt page margins if necessary // check page for no-write regions and adapt page margins if necessary
list($x, $y) = $this->checkPageRegions($h, $x, $y); list($x, $y) = $this->checkPageRegions($h, $x, $y);
$k = $this->k; $k = $this->k;
if ($file{0} === '@') { // image from string if ($file[0] === '@') { // image from string
$data = substr($file, 1); $data = substr($file, 1);
} else { // EPS/AI file } else { // EPS/AI file
$data = file_get_contents($file); $data = file_get_contents($file);
@@ -18997,7 +18997,7 @@ class TCPDF {
$cnt = count($lines); $cnt = count($lines);
for ($i=0; $i < $cnt; ++$i) { for ($i=0; $i < $cnt; ++$i) {
$line = $lines[$i]; $line = $lines[$i];
if (($line == '') OR ($line{0} == '%')) { if (($line == '') OR ($line[0] == '%')) {
continue; continue;
} }
$len = strlen($line); $len = strlen($line);
@@ -19989,19 +19989,19 @@ class TCPDF {
// remove empty blocks // remove empty blocks
$cssdata = preg_replace('/([^\}\{]+)\{\}/', '', $cssdata); $cssdata = preg_replace('/([^\}\{]+)\{\}/', '', $cssdata);
// replace media type parenthesis // replace media type parenthesis
$cssdata = preg_replace('/@media[\s]+([^\{]*)\{/i', '@media \\1§', $cssdata); $cssdata = preg_replace('/@media[\s]+([^\{]*)\{/i', '@media \\1<EFBFBD>', $cssdata);
$cssdata = preg_replace('/\}\}/si', '}§', $cssdata); $cssdata = preg_replace('/\}\}/si', '}<EFBFBD>', $cssdata);
// trim string // trim string
$cssdata = trim($cssdata); $cssdata = trim($cssdata);
// find media blocks (all, braille, embossed, handheld, print, projection, screen, speech, tty, tv) // find media blocks (all, braille, embossed, handheld, print, projection, screen, speech, tty, tv)
$cssblocks = array(); $cssblocks = array();
$matches = array(); $matches = array();
if (preg_match_all('/@media[\s]+([^\§]*)§([^§]*)§/i', $cssdata, $matches) > 0) { if (preg_match_all('/@media[\s]+([^\<EFBFBD>]*)<EFBFBD>([^<EFBFBD>]*)<EFBFBD>/i', $cssdata, $matches) > 0) {
foreach ($matches[1] as $key => $type) { foreach ($matches[1] as $key => $type) {
$cssblocks[$type] = $matches[2][$key]; $cssblocks[$type] = $matches[2][$key];
} }
// remove media blocks // remove media blocks
$cssdata = preg_replace('/@media[\s]+([^\§]*)§([^§]*)§/i', '', $cssdata); $cssdata = preg_replace('/@media[\s]+([^\<EFBFBD>]*)<EFBFBD>([^<EFBFBD>]*)<EFBFBD>/i', '', $cssdata);
} }
// keep 'all' and 'print' media, other media types are discarded // keep 'all' and 'print' media, other media types are discarded
if (isset($cssblocks['all']) AND !empty($cssblocks['all'])) { if (isset($cssblocks['all']) AND !empty($cssblocks['all'])) {
@@ -20093,7 +20093,7 @@ class TCPDF {
$attrib = strtolower(trim($attrib[0])); $attrib = strtolower(trim($attrib[0]));
if (!empty($attrib)) { if (!empty($attrib)) {
// check if matches class, id, attribute, pseudo-class or pseudo-element // check if matches class, id, attribute, pseudo-class or pseudo-element
switch ($attrib{0}) { switch ($attrib[0]) {
case '.': { // class case '.': { // class
if (in_array(substr($attrib, 1), $class)) { if (in_array(substr($attrib, 1), $class)) {
$valid = true; $valid = true;
@@ -20160,7 +20160,7 @@ class TCPDF {
break; break;
} }
case ':': { // pseudo-class or pseudo-element case ':': { // pseudo-class or pseudo-element
if ($attrib{1} == ':') { // pseudo-element if ($attrib[1] == ':') { // pseudo-element
// pseudo-elements are not supported! // pseudo-elements are not supported!
// (::first-line, ::first-letter, ::before, ::after) // (::first-line, ::first-letter, ::before, ::after)
} else { // pseudo-class } else { // pseudo-class
@@ -20837,7 +20837,7 @@ class TCPDF {
$tagname = strtolower($tag[1]); $tagname = strtolower($tag[1]);
// check if we are inside a table header // check if we are inside a table header
if ($tagname == 'thead') { if ($tagname == 'thead') {
if ($element{0} == '/') { if ($element[0] == '/') {
$thead = false; $thead = false;
} else { } else {
$thead = true; $thead = true;
@@ -20852,7 +20852,7 @@ class TCPDF {
} else { } else {
$dom[$key]['block'] = false; $dom[$key]['block'] = false;
} }
if ($element{0} == '/') { if ($element[0] == '/') {
// *** closing html tag // *** closing html tag
$dom[$key]['opening'] = false; $dom[$key]['opening'] = false;
$dom[$key]['parent'] = end($level); $dom[$key]['parent'] = end($level);
@@ -21066,15 +21066,15 @@ class TCPDF {
} }
// font style // font style
if (isset($dom[$key]['style']['font-weight'])) { if (isset($dom[$key]['style']['font-weight'])) {
if (strtolower($dom[$key]['style']['font-weight']{0}) == 'n') { if (strtolower($dom[$key]['style']['font-weight'][0]) == 'n') {
if (strpos($dom[$key]['fontstyle'], 'B') !== false) { if (strpos($dom[$key]['fontstyle'], 'B') !== false) {
$dom[$key]['fontstyle'] = str_replace('B', '', $dom[$key]['fontstyle']); $dom[$key]['fontstyle'] = str_replace('B', '', $dom[$key]['fontstyle']);
} }
} elseif (strtolower($dom[$key]['style']['font-weight']{0}) == 'b') { } elseif (strtolower($dom[$key]['style']['font-weight'][0]) == 'b') {
$dom[$key]['fontstyle'] .= 'B'; $dom[$key]['fontstyle'] .= 'B';
} }
} }
if (isset($dom[$key]['style']['font-style']) AND (strtolower($dom[$key]['style']['font-style']{0}) == 'i')) { if (isset($dom[$key]['style']['font-style']) AND (strtolower($dom[$key]['style']['font-style'][0]) == 'i')) {
$dom[$key]['fontstyle'] .= 'I'; $dom[$key]['fontstyle'] .= 'I';
} }
// font color // font color
@@ -21093,13 +21093,13 @@ class TCPDF {
foreach ($decors as $dec) { foreach ($decors as $dec) {
$dec = trim($dec); $dec = trim($dec);
if (!$this->empty_string($dec)) { if (!$this->empty_string($dec)) {
if ($dec{0} == 'u') { if ($dec[0] == 'u') {
// underline // underline
$dom[$key]['fontstyle'] .= 'U'; $dom[$key]['fontstyle'] .= 'U';
} elseif ($dec{0} == 'l') { } elseif ($dec[0] == 'l') {
// line-trough // line-trough
$dom[$key]['fontstyle'] .= 'D'; $dom[$key]['fontstyle'] .= 'D';
} elseif ($dec{0} == 'o') { } elseif ($dec[0] == 'o') {
// overline // overline
$dom[$key]['fontstyle'] .= 'O'; $dom[$key]['fontstyle'] .= 'O';
} }
@@ -21118,7 +21118,7 @@ class TCPDF {
} }
// check for text alignment // check for text alignment
if (isset($dom[$key]['style']['text-align'])) { if (isset($dom[$key]['style']['text-align'])) {
$dom[$key]['align'] = strtoupper($dom[$key]['style']['text-align']{0}); $dom[$key]['align'] = strtoupper($dom[$key]['style']['text-align'][0]);
} }
// check for CSS border properties // check for CSS border properties
if (isset($dom[$key]['style']['border'])) { if (isset($dom[$key]['style']['border'])) {
@@ -21282,9 +21282,9 @@ class TCPDF {
// font size // font size
if (isset($dom[$key]['attribute']['size'])) { if (isset($dom[$key]['attribute']['size'])) {
if ($key > 0) { if ($key > 0) {
if ($dom[$key]['attribute']['size']{0} == '+') { if ($dom[$key]['attribute']['size'][0] == '+') {
$dom[$key]['fontsize'] = $dom[($dom[$key]['parent'])]['fontsize'] + intval(substr($dom[$key]['attribute']['size'], 1)); $dom[$key]['fontsize'] = $dom[($dom[$key]['parent'])]['fontsize'] + intval(substr($dom[$key]['attribute']['size'], 1));
} elseif ($dom[$key]['attribute']['size']{0} == '-') { } elseif ($dom[$key]['attribute']['size'][0] == '-') {
$dom[$key]['fontsize'] = $dom[($dom[$key]['parent'])]['fontsize'] - intval(substr($dom[$key]['attribute']['size'], 1)); $dom[$key]['fontsize'] = $dom[($dom[$key]['parent'])]['fontsize'] - intval(substr($dom[$key]['attribute']['size'], 1));
} else { } else {
$dom[$key]['fontsize'] = intval($dom[$key]['attribute']['size']); $dom[$key]['fontsize'] = intval($dom[$key]['attribute']['size']);
@@ -21326,10 +21326,10 @@ class TCPDF {
if (($dom[$key]['value'] == 'pre') OR ($dom[$key]['value'] == 'tt')) { if (($dom[$key]['value'] == 'pre') OR ($dom[$key]['value'] == 'tt')) {
$dom[$key]['fontname'] = $this->default_monospaced_font; $dom[$key]['fontname'] = $this->default_monospaced_font;
} }
if (($dom[$key]['value']{0} == 'h') AND (intval($dom[$key]['value']{1}) > 0) AND (intval($dom[$key]['value']{1}) < 7)) { if (($dom[$key]['value'][0] == 'h') AND (intval($dom[$key]['value'][1]) > 0) AND (intval($dom[$key]['value'][1]) < 7)) {
// headings h1, h2, h3, h4, h5, h6 // headings h1, h2, h3, h4, h5, h6
if (!isset($dom[$key]['attribute']['size']) AND !isset($dom[$key]['style']['font-size'])) { if (!isset($dom[$key]['attribute']['size']) AND !isset($dom[$key]['style']['font-size'])) {
$headsize = (4 - intval($dom[$key]['value']{1})) * 2; $headsize = (4 - intval($dom[$key]['value'][1])) * 2;
$dom[$key]['fontsize'] = $dom[0]['fontsize'] + $headsize; $dom[$key]['fontsize'] = $dom[0]['fontsize'] + $headsize;
} }
if (!isset($dom[$key]['style']['font-weight'])) { if (!isset($dom[$key]['style']['font-weight'])) {
@@ -21391,7 +21391,7 @@ class TCPDF {
} }
// check for text alignment // check for text alignment
if (isset($dom[$key]['attribute']['align']) AND (!$this->empty_string($dom[$key]['attribute']['align'])) AND ($dom[$key]['value'] !== 'img')) { if (isset($dom[$key]['attribute']['align']) AND (!$this->empty_string($dom[$key]['attribute']['align'])) AND ($dom[$key]['value'] !== 'img')) {
$dom[$key]['align'] = strtoupper($dom[$key]['attribute']['align']{0}); $dom[$key]['align'] = strtoupper($dom[$key]['attribute']['align'][0]);
} }
// check for text rendering mode (the following attributes do not exist in HTML) // check for text rendering mode (the following attributes do not exist in HTML)
if (isset($dom[$key]['attribute']['stroke'])) { if (isset($dom[$key]['attribute']['stroke'])) {
@@ -23116,7 +23116,7 @@ Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value:
} }
case 'img': { case 'img': {
if (isset($tag['attribute']['src'])) { if (isset($tag['attribute']['src'])) {
if ($tag['attribute']['src']{0} === '@') { if ($tag['attribute']['src'][0] === '@') {
// data stream // data stream
$tag['attribute']['src'] = '@'.base64_decode(substr($tag['attribute']['src'], 1)); $tag['attribute']['src'] = '@'.base64_decode(substr($tag['attribute']['src'], 1));
$type = ''; $type = '';
@@ -23178,7 +23178,7 @@ Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value:
$imglink = ''; $imglink = '';
if (isset($this->HREF['url']) AND !$this->empty_string($this->HREF['url'])) { if (isset($this->HREF['url']) AND !$this->empty_string($this->HREF['url'])) {
$imglink = $this->HREF['url']; $imglink = $this->HREF['url'];
if ($imglink{0} == '#') { if ($imglink[0] == '#') {
// convert url to internal link // convert url to internal link
$lnkdata = explode(',', $imglink); $lnkdata = explode(',', $imglink);
if (isset($lnkdata[0])) { if (isset($lnkdata[0])) {
@@ -27144,7 +27144,7 @@ Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value:
// convert SVG to raster image using GD or ImageMagick libraries // convert SVG to raster image using GD or ImageMagick libraries
return $this->Image($file, $x, $y, $w, $h, 'SVG', $link, $align, true, 300, $palign, false, false, $border, false, false, false); return $this->Image($file, $x, $y, $w, $h, 'SVG', $link, $align, true, 300, $palign, false, false, $border, false, false, false);
} }
if ($file{0} === '@') { // image from string if ($file[0] === '@') { // image from string
$this->svgdir = ''; $this->svgdir = '';
$svgdata = substr($file, 1); $svgdata = substr($file, 1);
} else { // SVG file } else { // SVG file
@@ -28054,7 +28054,7 @@ Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value:
} }
break; break;
} }
case 'Q': { // quadratic Bézier curveto case 'Q': { // quadratic B<EFBFBD>zier curveto
foreach ($params as $ck => $cp) { foreach ($params as $ck => $cp) {
$params[$ck] = $cp; $params[$ck] = $cp;
if ((($ck + 1) % 4) == 0) { if ((($ck + 1) % 4) == 0) {
@@ -28080,7 +28080,7 @@ Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value:
} }
break; break;
} }
case 'T': { // shorthand/smooth quadratic Bézier curveto case 'T': { // shorthand/smooth quadratic B<EFBFBD>zier curveto
foreach ($params as $ck => $cp) { foreach ($params as $ck => $cp) {
$params[$ck] = $cp; $params[$ck] = $cp;
if (($ck % 2) != 0) { if (($ck % 2) != 0) {
@@ -28631,7 +28631,7 @@ Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value:
$img = '@'.base64_decode(substr($img, strlen($m[0]))); $img = '@'.base64_decode(substr($img, strlen($m[0])));
} else { } else {
// fix image path // fix image path
if (!$this->empty_string($this->svgdir) AND (($img{0} == '.') OR (basename($img) == $img))) { if (!$this->empty_string($this->svgdir) AND (($img[0] == '.') OR (basename($img) == $img))) {
// replace relative path with full server path // replace relative path with full server path
$img = $this->svgdir.'/'.$img; $img = $this->svgdir.'/'.$img;
} }

View File

@@ -288,7 +288,7 @@ function PMA_get_arg_separator($encode = 'none')
if (strpos($php_arg_separator_input, ';') !== false) { if (strpos($php_arg_separator_input, ';') !== false) {
$separator = ';'; $separator = ';';
} elseif (strlen($php_arg_separator_input) > 0) { } elseif (strlen($php_arg_separator_input) > 0) {
$separator = $php_arg_separator_input{0}; $separator = $php_arg_separator_input[0];
} else { } else {
$separator = '&'; $separator = '&';
} }

View File

@@ -1275,7 +1275,7 @@ if (isset($_REQUEST['delete']) || (isset($_REQUEST['change_copy']) && $_REQUEST[
} }
$drop_user_error = ''; $drop_user_error = '';
foreach ($queries as $sql_query) { foreach ($queries as $sql_query) {
if ($sql_query{0} != '#') { if ($sql_query[0] != '#') {
if (! PMA_DBI_try_query($sql_query, $GLOBALS['userlink'])) { if (! PMA_DBI_try_query($sql_query, $GLOBALS['userlink'])) {
$drop_user_error .= PMA_DBI_getError() . "\n"; $drop_user_error .= PMA_DBI_getError() . "\n";
} }
@@ -1302,7 +1302,7 @@ if (isset($_REQUEST['delete']) || (isset($_REQUEST['change_copy']) && $_REQUEST[
if (isset($_REQUEST['change_copy'])) { if (isset($_REQUEST['change_copy'])) {
$tmp_count = 0; $tmp_count = 0;
foreach ($queries as $sql_query) { foreach ($queries as $sql_query) {
if ($sql_query{0} != '#') { if ($sql_query[0] != '#') {
PMA_DBI_query($sql_query); PMA_DBI_query($sql_query);
} }
// when there is a query containing a hidden password, take it // when there is a query containing a hidden password, take it