diff --git a/include/Zend/Json/Decoder.php b/include/Zend/Json/Decoder.php index fdf04bb013d7d7632707a270a24b9eb2eb6e580c..cc7a1f834c4254ccd805b53bcf8de8abe41c4dd6 100644 --- a/include/Zend/Json/Decoder.php +++ b/include/Zend/Json/Decoder.php @@ -320,7 +320,7 @@ class Zend_Json_Decoder $i = $this->_offset; $start = $i; - switch ($str{$i}) { + switch ($str[$i]) { case '{': $this->_token = self::LBRACE; break; @@ -347,13 +347,13 @@ class Zend_Json_Decoder break; } - $chr = $str{$i}; + $chr = $str[$i]; if ($chr == '\\') { $i++; if ($i >= $str_length) { break; } - $chr = $str{$i}; + $chr = $str[$i]; switch ($chr) { case '"' : $result .= '"'; @@ -425,7 +425,7 @@ class Zend_Json_Decoder return($this->_token); } - $chr = $str{$i}; + $chr = $str[$i]; if ($chr == '-' || $chr == '.' || ($chr >= '0' && $chr <= '9')) { if (preg_match('/-?([0-9])*(\.[0-9]*)?((e|E)((-|\+)?)[0-9]+)?/s', $str, $matches, PREG_OFFSET_CAPTURE, $start) && $matches[0][1] == $start) { @@ -484,7 +484,7 @@ class Zend_Json_Decoder $i += 5; break; case ($ord_chrs_c >= 0x20) && ($ord_chrs_c <= 0x7F): - $utf8 .= $chrs{$i}; + $utf8 .= $chrs[$i]; break; case ($ord_chrs_c & 0xE0) == 0xC0: // characters U-00000080 - U-000007FF, mask 110XXXXX @@ -542,7 +542,7 @@ class Zend_Json_Decoder return mb_convert_encoding($utf16, 'UTF-8', 'UTF-16'); } - $bytes = (ord($utf16{0}) << 8) | ord($utf16{1}); + $bytes = (ord($utf16[0]) << 8) | ord($utf16[1]); switch (true) { case ((0x7F & $bytes) == $bytes): diff --git a/include/utils/GraphUtils.php b/include/utils/GraphUtils.php index 7986ce82d0e2ce55af80d4d18cdf4abcaf656eef..923fd3c9e6085dd77442932b7f959267c28c79ad 100644 --- a/include/utils/GraphUtils.php +++ b/include/utils/GraphUtils.php @@ -75,8 +75,8 @@ function color_generator($count = 1, $start = '33CCFF', $step = '221133') global $log; $log->debug("Entering color_generator(".$count.",".$start.",".$step.") method ..."); // explode color strings to RGB array - if($start{0} == "#") $start = substr($start,1); - if($step{0} == "#") $step = substr($step,1); + if($start[0] == "#") $start = substr($start,1); + if($step[0] == "#") $step = substr($step,1); // pad shorter strings with 0 $start = substr($start."000000",0,6); $step = substr($step."000000",0,6); diff --git a/include/utils/encryption.php b/include/utils/encryption.php index 2b73a11d5e4f640581305c56f6cf96e5dd0a39a6..64a7429d46ec2d15461e7889a6d3de1175735085 100644 --- a/include/utils/encryption.php +++ b/include/utils/encryption.php @@ -25,7 +25,7 @@ class Encryption $strSize = strlen($inputString); for($x=0; $x<$strSize; $x++) { - $charBin = decbin(ord($inputString{$x})); + $charBin = decbin(ord($inputString[$x])); $charBin = str_pad($charBin, $byteLength, '0', STR_PAD_LEFT); $binaryOutput .= $charBin; } diff --git a/kcfinder/core/autoload.php b/kcfinder/core/autoload.php index 7814cc15dd858148264f9490604ef17f9614bb2e..816eb7e09fa8f86adc5e43074913ebbc77afb879 100644 --- a/kcfinder/core/autoload.php +++ b/kcfinder/core/autoload.php @@ -12,7 +12,7 @@ * @link http://kcfinder.sunhater.com */ -function __autoload($class) { +spl_autoload_register(function($class) { if ($class == "uploader") require "core/uploader.php"; elseif ($class == "browser") @@ -23,6 +23,6 @@ function __autoload($class) { require "lib/class_$class.php"; elseif (file_exists("lib/helper_$class.php")) require "lib/helper_$class.php"; -} +}); ?> \ No newline at end of file diff --git a/libraries/PHPExcel/PHPExcel/Calculation.php b/libraries/PHPExcel/PHPExcel/Calculation.php index 64736d7ab459aec7ccafd2332018326b262e9832..702e793622c131ee8e2eca28e14ffd6c6dafc8ae 100644 --- a/libraries/PHPExcel/PHPExcel/Calculation.php +++ b/libraries/PHPExcel/PHPExcel/Calculation.php @@ -2100,7 +2100,7 @@ class PHPExcel_Calculation { */ public static function _unwrapResult($value) { if (is_string($value)) { - if ((isset($value{0})) && ($value{0} == '"') && (substr($value,-1) == '"')) { + if ((isset($value[0])) && ($value[0] == '"') && (substr($value,-1) == '"')) { return substr($value,1,-1); } // Convert numeric errors to NaN error @@ -2208,9 +2208,9 @@ class PHPExcel_Calculation { // Basic validation that this is indeed a formula // We return an empty array if not $formula = trim($formula); - if ((!isset($formula{0})) || ($formula{0} != '=')) return array(); + if ((!isset($formula[0])) || ($formula[0] != '=')) return array(); $formula = ltrim(substr($formula,1)); - if (!isset($formula{0})) return array(); + if (!isset($formula[0])) return array(); // Parse the formula and return the token stack return $this->_parseFormula($formula); @@ -2263,7 +2263,7 @@ class PHPExcel_Calculation { // Basic validation that this is indeed a formula // We simply return the "cell value" (formula) if not $formula = trim($formula); - if ($formula{0} != '=') return self::_wrapResult($formula); + if ($formula[0] != '=') return self::_wrapResult($formula); $formula = ltrim(substr($formula,1)); if (!isset($formula{0})) return self::_wrapResult($formula); @@ -2547,7 +2547,7 @@ class PHPExcel_Calculation { } else { if ($value == '') { return 'an empty string'; - } elseif ($value{0} == '#') { + } elseif ($value[0] == '#') { return 'a '.$value.' error'; } else { $typeString = 'a string'; @@ -2673,10 +2673,10 @@ class PHPExcel_Calculation { // Loop through the formula extracting each operator and operand in turn while(true) { // echo 'Assessing Expression <b>'.substr($formula, $index).'</b><br />'; - $opCharacter = $formula{$index}; // Get the first character of the value at the current index position + $opCharacter = $formula[$index]; // Get the first character of the value at the current index position // echo 'Initial character of expression block is '.$opCharacter.'<br />'; - if ((isset($comparisonOperators[$opCharacter])) && (strlen($formula) > $index) && (isset($comparisonOperators[$formula{$index+1}]))) { - $opCharacter .= $formula{++$index}; + if ((isset($comparisonOperators[$opCharacter])) && (strlen($formula) > $index) && (isset($comparisonOperators[$formula[$index+1]]))) { + $opCharacter .= $formula[++$index]; // echo 'Initial character of expression block is comparison operator '.$opCharacter.'<br />'; } @@ -2951,11 +2951,11 @@ class PHPExcel_Calculation { } } // Ignore white space - while (($formula{$index} == "\n") || ($formula{$index} == "\r")) { + while (($formula[$index] == "\n") || ($formula[$index] == "\r")) { ++$index; } - if ($formula{$index} == ' ') { - while ($formula{$index} == ' ') { + if ($formula[$index] == ' ') { + while ($formula[$index] == ' ') { ++$index; } // If we're expecting an operator, but only have a space between the previous and next operands (and both are @@ -3369,7 +3369,7 @@ class PHPExcel_Calculation { // echo 'Token is a PHPExcel constant: '.$excelConstant.'<br />'; $stack->push('Constant Value',self::$_ExcelConstants[$excelConstant]); $this->_writeDebug('Evaluating Constant '.$excelConstant.' as '.$this->_showTypeDetails(self::$_ExcelConstants[$excelConstant])); - } elseif ((is_numeric($token)) || ($token === NULL) || (is_bool($token)) || ($token == '') || ($token{0} == '"') || ($token{0} == '#')) { + } elseif ((is_numeric($token)) || ($token === NULL) || (is_bool($token)) || ($token == '') || ($token[0] == '"') || ($token[0] == '#')) { // echo 'Token is a number, boolean, string, null or an Excel error<br />'; $stack->push('Value',$token); // if the token is a named range, push the named range name onto the stack @@ -3404,11 +3404,11 @@ class PHPExcel_Calculation { if (is_string($operand)) { // We only need special validations for the operand if it is a string // Start by stripping off the quotation marks we use to identify true excel string values internally - if ($operand > '' && $operand{0} == '"') { $operand = self::_unwrapResult($operand); } + if ($operand > '' && $operand[0] == '"') { $operand = self::_unwrapResult($operand); } // If the string is a numeric value, we treat it as a numeric, so no further testing if (!is_numeric($operand)) { // If not a numeric, test to see if the value is an Excel error, and so can't be used in normal binary operations - if ($operand > '' && $operand{0} == '#') { + if ($operand > '' && $operand[0] == '#') { $stack->push('Value', $operand); $this->_writeDebug('Evaluation Result is '.$this->_showTypeDetails($operand)); return false; @@ -3461,8 +3461,8 @@ class PHPExcel_Calculation { } // Simple validate the two operands if they are string values - if (is_string($operand1) && $operand1 > '' && $operand1{0} == '"') { $operand1 = self::_unwrapResult($operand1); } - if (is_string($operand2) && $operand2 > '' && $operand2{0} == '"') { $operand2 = self::_unwrapResult($operand2); } + if (is_string($operand1) && $operand1 > '' && $operand1[0] == '"') { $operand1 = self::_unwrapResult($operand1); } + if (is_string($operand2) && $operand2 > '' && $operand2[0] == '"') { $operand2 = self::_unwrapResult($operand2); } // execute the necessary operation switch ($operation) { diff --git a/libraries/PHPExcel/PHPExcel/Calculation/Engineering.php b/libraries/PHPExcel/PHPExcel/Calculation/Engineering.php index 4bf895a3096be6d49546271a498fc85ffb32c2eb..06c0c98b19dc7ec5c35636810a4befb98774aa72 100644 --- a/libraries/PHPExcel/PHPExcel/Calculation/Engineering.php +++ b/libraries/PHPExcel/PHPExcel/Calculation/Engineering.php @@ -708,7 +708,7 @@ class PHPExcel_Calculation_Engineering { // Split the input into its Real and Imaginary components $leadingSign = 0; if (strlen($workString) > 0) { - $leadingSign = (($workString{0} == '+') || ($workString{0} == '-')) ? 1 : 0; + $leadingSign = (($workString[0] == '+') || ($workString[0] == '-')) ? 1 : 0; } $power = ''; $realNumber = strtok($workString, '+-'); @@ -749,10 +749,10 @@ class PHPExcel_Calculation_Engineering { * @return string The "cleaned" complex number */ private static function _cleanComplex($complexNumber) { - if ($complexNumber{0} == '+') $complexNumber = substr($complexNumber,1); - if ($complexNumber{0} == '0') $complexNumber = substr($complexNumber,1); - if ($complexNumber{0} == '.') $complexNumber = '0'.$complexNumber; - if ($complexNumber{0} == '+') $complexNumber = substr($complexNumber,1); + if ($complexNumber[0] == '+') $complexNumber = substr($complexNumber,1); + if ($complexNumber[0] == '0') $complexNumber = substr($complexNumber,1); + if ($complexNumber[0] == '.') $complexNumber = '0'.$complexNumber; + if ($complexNumber[0] == '+') $complexNumber = substr($complexNumber,1); return $complexNumber; } diff --git a/libraries/PHPExcel/PHPExcel/Calculation/FormulaParser.php b/libraries/PHPExcel/PHPExcel/Calculation/FormulaParser.php index 5f62da486da3c579ec7a49578f789f2e46c30f5d..c588aaed194e473a87d9c9070968f0e0c06f34ea 100644 --- a/libraries/PHPExcel/PHPExcel/Calculation/FormulaParser.php +++ b/libraries/PHPExcel/PHPExcel/Calculation/FormulaParser.php @@ -159,7 +159,7 @@ class PHPExcel_Calculation_FormulaParser { // Check if the formula has a valid starting = $formulaLength = strlen($this->_formula); - if ($formulaLength < 2 || $this->_formula{0} != '=') return; + if ($formulaLength < 2 || $this->_formula[0] != '=') return; // Helper variables $tokens1 = $tokens2 = $stack = array(); @@ -179,8 +179,8 @@ class PHPExcel_Calculation_FormulaParser { // embeds are doubled // end marks token if ($inString) { - if ($this->_formula{$index} == PHPExcel_Calculation_FormulaParser::QUOTE_DOUBLE) { - if ((($index + 2) <= $formulaLength) && ($this->_formula{$index + 1} == PHPExcel_Calculation_FormulaParser::QUOTE_DOUBLE)) { + if ($this->_formula[$index] == PHPExcel_Calculation_FormulaParser::QUOTE_DOUBLE) { + if ((($index + 2) <= $formulaLength) && ($this->_formula[$index + 1] == PHPExcel_Calculation_FormulaParser::QUOTE_DOUBLE)) { $value .= PHPExcel_Calculation_FormulaParser::QUOTE_DOUBLE; ++$index; } else { @@ -189,7 +189,7 @@ class PHPExcel_Calculation_FormulaParser { $value = ""; } } else { - $value .= $this->_formula{$index}; + $value .= $this->_formula[$index]; } ++$index; continue; @@ -199,15 +199,15 @@ class PHPExcel_Calculation_FormulaParser { // embeds are double // end does not mark a token if ($inPath) { - if ($this->_formula{$index} == PHPExcel_Calculation_FormulaParser::QUOTE_SINGLE) { - if ((($index + 2) <= $formulaLength) && ($this->_formula{$index + 1} == PHPExcel_Calculation_FormulaParser::QUOTE_SINGLE)) { + if ($this->_formula[$index] == PHPExcel_Calculation_FormulaParser::QUOTE_SINGLE) { + if ((($index + 2) <= $formulaLength) && ($this->_formula[$index + 1] == PHPExcel_Calculation_FormulaParser::QUOTE_SINGLE)) { $value .= PHPExcel_Calculation_FormulaParser::QUOTE_SINGLE; ++$index; } else { $inPath = false; } } else { - $value .= $this->_formula{$index}; + $value .= $this->_formula[$index]; } ++$index; continue; @@ -217,10 +217,10 @@ class PHPExcel_Calculation_FormulaParser { // no embeds (changed to "()" by Excel) // end does not mark a token if ($inRange) { - if ($this->_formula{$index} == PHPExcel_Calculation_FormulaParser::BRACKET_CLOSE) { + if ($this->_formula[$index] == PHPExcel_Calculation_FormulaParser::BRACKET_CLOSE) { $inRange = false; } - $value .= $this->_formula{$index}; + $value .= $this->_formula[$index]; ++$index; continue; } @@ -228,7 +228,7 @@ class PHPExcel_Calculation_FormulaParser { // error values // end marks a token, determined from absolute list of values if ($inError) { - $value .= $this->_formula{$index}; + $value .= $this->_formula[$index]; ++$index; if (in_array($value, $ERRORS)) { $inError = false; @@ -239,10 +239,10 @@ class PHPExcel_Calculation_FormulaParser { } // scientific notation check - if (strpos(PHPExcel_Calculation_FormulaParser::OPERATORS_SN, $this->_formula{$index}) !== false) { + if (strpos(PHPExcel_Calculation_FormulaParser::OPERATORS_SN, $this->_formula[$index]) !== false) { if (strlen($value) > 1) { - if (preg_match("/^[1-9]{1}(\.[0-9]+)?E{1}$/", $this->_formula{$index}) != 0) { - $value .= $this->_formula{$index}; + if (preg_match("/^[1-9]{1}(\.[0-9]+)?E{1}$/", $this->_formula[$index]) != 0) { + $value .= $this->_formula[$index]; ++$index; continue; } @@ -252,7 +252,7 @@ class PHPExcel_Calculation_FormulaParser { // independent character evaluation (order not important) // establish state-dependent character evaluations - if ($this->_formula{$index} == PHPExcel_Calculation_FormulaParser::QUOTE_DOUBLE) { + if ($this->_formula[$index] == PHPExcel_Calculation_FormulaParser::QUOTE_DOUBLE) { if (strlen($value > 0)) { // unexpected $tokens1[] = new PHPExcel_Calculation_FormulaToken($value, PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_UNKNOWN); $value = ""; @@ -262,7 +262,7 @@ class PHPExcel_Calculation_FormulaParser { continue; } - if ($this->_formula{$index} == PHPExcel_Calculation_FormulaParser::QUOTE_SINGLE) { + if ($this->_formula[$index] == PHPExcel_Calculation_FormulaParser::QUOTE_SINGLE) { if (strlen($value) > 0) { // unexpected $tokens1[] = new PHPExcel_Calculation_FormulaToken($value, PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_UNKNOWN); $value = ""; @@ -272,14 +272,14 @@ class PHPExcel_Calculation_FormulaParser { continue; } - if ($this->_formula{$index} == PHPExcel_Calculation_FormulaParser::BRACKET_OPEN) { + if ($this->_formula[$index] == PHPExcel_Calculation_FormulaParser::BRACKET_OPEN) { $inRange = true; $value .= PHPExcel_Calculation_FormulaParser::BRACKET_OPEN; ++$index; continue; } - if ($this->_formula{$index} == PHPExcel_Calculation_FormulaParser::ERROR_START) { + if ($this->_formula[$index] == PHPExcel_Calculation_FormulaParser::ERROR_START) { if (strlen($value) > 0) { // unexpected $tokens1[] = new PHPExcel_Calculation_FormulaToken($value, PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_UNKNOWN); $value = ""; @@ -291,7 +291,7 @@ class PHPExcel_Calculation_FormulaParser { } // mark start and end of arrays and array rows - if ($this->_formula{$index} == PHPExcel_Calculation_FormulaParser::BRACE_OPEN) { + if ($this->_formula[$index] == PHPExcel_Calculation_FormulaParser::BRACE_OPEN) { if (strlen($value) > 0) { // unexpected $tokens1[] = new PHPExcel_Calculation_FormulaToken($value, PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_UNKNOWN); $value = ""; @@ -309,7 +309,7 @@ class PHPExcel_Calculation_FormulaParser { continue; } - if ($this->_formula{$index} == PHPExcel_Calculation_FormulaParser::SEMICOLON) { + if ($this->_formula[$index] == PHPExcel_Calculation_FormulaParser::SEMICOLON) { if (strlen($value) > 0) { $tokens1[] = new PHPExcel_Calculation_FormulaToken($value, PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERAND); $value = ""; @@ -331,7 +331,7 @@ class PHPExcel_Calculation_FormulaParser { continue; } - if ($this->_formula{$index} == PHPExcel_Calculation_FormulaParser::BRACE_CLOSE) { + if ($this->_formula[$index] == PHPExcel_Calculation_FormulaParser::BRACE_CLOSE) { if (strlen($value) > 0) { $tokens1[] = new PHPExcel_Calculation_FormulaToken($value, PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERAND); $value = ""; @@ -352,14 +352,14 @@ class PHPExcel_Calculation_FormulaParser { } // trim white-space - if ($this->_formula{$index} == PHPExcel_Calculation_FormulaParser::WHITESPACE) { + if ($this->_formula[$index] == PHPExcel_Calculation_FormulaParser::WHITESPACE) { if (strlen($value) > 0) { $tokens1[] = new PHPExcel_Calculation_FormulaToken($value, PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERAND); $value = ""; } $tokens1[] = new PHPExcel_Calculation_FormulaToken("", PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_WHITESPACE); ++$index; - while (($this->_formula{$index} == PHPExcel_Calculation_FormulaParser::WHITESPACE) && ($index < $formulaLength)) { + while (($this->_formula[$index] == PHPExcel_Calculation_FormulaParser::WHITESPACE) && ($index < $formulaLength)) { ++$index; } continue; @@ -379,29 +379,29 @@ class PHPExcel_Calculation_FormulaParser { } // standard infix operators - if (strpos(PHPExcel_Calculation_FormulaParser::OPERATORS_INFIX, $this->_formula{$index}) !== false) { + if (strpos(PHPExcel_Calculation_FormulaParser::OPERATORS_INFIX, $this->_formula[$index]) !== false) { if (strlen($value) > 0) { $tokens1[] =new PHPExcel_Calculation_FormulaToken($value, PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERAND); $value = ""; } - $tokens1[] = new PHPExcel_Calculation_FormulaToken($this->_formula{$index}, PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERATORINFIX); + $tokens1[] = new PHPExcel_Calculation_FormulaToken($this->_formula[$index], PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERATORINFIX); ++$index; continue; } // standard postfix operators (only one) - if (strpos(PHPExcel_Calculation_FormulaParser::OPERATORS_POSTFIX, $this->_formula{$index}) !== false) { + if (strpos(PHPExcel_Calculation_FormulaParser::OPERATORS_POSTFIX, $this->_formula[$index]) !== false) { if (strlen($value) > 0) { $tokens1[] = new PHPExcel_Calculation_FormulaToken($value, PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERAND); $value = ""; } - $tokens1[] = new PHPExcel_Calculation_FormulaToken($this->_formula{$index}, PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERATORPOSTFIX); + $tokens1[] = new PHPExcel_Calculation_FormulaToken($this->_formula[$index], PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERATORPOSTFIX); ++$index; continue; } // start subexpression or function - if ($this->_formula{$index} == PHPExcel_Calculation_FormulaParser::PAREN_OPEN) { + if ($this->_formula[$index] == PHPExcel_Calculation_FormulaParser::PAREN_OPEN) { if (strlen($value) > 0) { $tmp = new PHPExcel_Calculation_FormulaToken($value, PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_FUNCTION, PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_START); $tokens1[] = $tmp; @@ -417,7 +417,7 @@ class PHPExcel_Calculation_FormulaParser { } // function, subexpression, or array parameters, or operand unions - if ($this->_formula{$index} == PHPExcel_Calculation_FormulaParser::COMMA) { + if ($this->_formula[$index] == PHPExcel_Calculation_FormulaParser::COMMA) { if (strlen($value) > 0) { $tokens1[] = new PHPExcel_Calculation_FormulaToken($value, PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERAND); $value = ""; @@ -438,7 +438,7 @@ class PHPExcel_Calculation_FormulaParser { } // stop subexpression - if ($this->_formula{$index} == PHPExcel_Calculation_FormulaParser::PAREN_CLOSE) { + if ($this->_formula[$index] == PHPExcel_Calculation_FormulaParser::PAREN_CLOSE) { if (strlen($value) > 0) { $tokens1[] = new PHPExcel_Calculation_FormulaToken($value, PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERAND); $value = ""; @@ -454,7 +454,7 @@ class PHPExcel_Calculation_FormulaParser { } // token accumulation - $value .= $this->_formula{$index}; + $value .= $this->_formula[$index]; ++$index; } diff --git a/libraries/PHPExcel/PHPExcel/Calculation/Functions.php b/libraries/PHPExcel/PHPExcel/Calculation/Functions.php index 3666d38f983683329a6cc3d9340f70d608604b60..ce58e195c19d5a442c729f17e7f7e8b70ee42a63 100644 --- a/libraries/PHPExcel/PHPExcel/Calculation/Functions.php +++ b/libraries/PHPExcel/PHPExcel/Calculation/Functions.php @@ -308,7 +308,7 @@ class PHPExcel_Calculation_Functions { public static function _ifCondition($condition) { $condition = PHPExcel_Calculation_Functions::flattenSingleValue($condition); - if (!in_array($condition{0},array('>', '<', '='))) { + if (!in_array($condition[0],array('>', '<', '='))) { if (!is_numeric($condition)) { $condition = PHPExcel_Calculation::_wrapResult(strtoupper($condition)); } return '='.$condition; } else { @@ -524,7 +524,7 @@ class PHPExcel_Calculation_Functions { break; case 'string' : // Errors - if ((strlen($value) > 0) && ($value{0} == '#')) { + if ((strlen($value) > 0) && ($value[0] == '#')) { return $value; } break; @@ -573,7 +573,7 @@ class PHPExcel_Calculation_Functions { return 64; } elseif(is_string($value)) { // Errors - if ((strlen($value) > 0) && ($value{0} == '#')) { + if ((strlen($value) > 0) && ($value[0] == '#')) { return 16; } return 2; diff --git a/libraries/PHPExcel/PHPExcel/Calculation/TextData.php b/libraries/PHPExcel/PHPExcel/Calculation/TextData.php index 165164d93c7b124e62290457da90b252db3ac944..ba194cb4296ec1882d2562142cade6d20c2fb4dc 100644 --- a/libraries/PHPExcel/PHPExcel/Calculation/TextData.php +++ b/libraries/PHPExcel/PHPExcel/Calculation/TextData.php @@ -48,19 +48,19 @@ class PHPExcel_Calculation_TextData { private static $_invalidChars = Null; private static function _uniord($c) { - if (ord($c{0}) >=0 && ord($c{0}) <= 127) - return ord($c{0}); - if (ord($c{0}) >= 192 && ord($c{0}) <= 223) - return (ord($c{0})-192)*64 + (ord($c{1})-128); - if (ord($c{0}) >= 224 && ord($c{0}) <= 239) - return (ord($c{0})-224)*4096 + (ord($c{1})-128)*64 + (ord($c{2})-128); - if (ord($c{0}) >= 240 && ord($c{0}) <= 247) - return (ord($c{0})-240)*262144 + (ord($c{1})-128)*4096 + (ord($c{2})-128)*64 + (ord($c{3})-128); - if (ord($c{0}) >= 248 && ord($c{0}) <= 251) - return (ord($c{0})-248)*16777216 + (ord($c{1})-128)*262144 + (ord($c{2})-128)*4096 + (ord($c{3})-128)*64 + (ord($c{4})-128); - if (ord($c{0}) >= 252 && ord($c{0}) <= 253) - return (ord($c{0})-252)*1073741824 + (ord($c{1})-128)*16777216 + (ord($c{2})-128)*262144 + (ord($c{3})-128)*4096 + (ord($c{4})-128)*64 + (ord($c{5})-128); - if (ord($c{0}) >= 254 && ord($c{0}) <= 255) //error + if (ord($c[0]) >=0 && ord($c[0]) <= 127) + return ord($c[0]); + if (ord($c[0]) >= 192 && ord($c[0]) <= 223) + return (ord($c[0])-192)*64 + (ord($c[1])-128); + if (ord($c[0]) >= 224 && ord($c[0]) <= 239) + return (ord($c[0])-224)*4096 + (ord($c[1])-128)*64 + (ord($c[2])-128); + if (ord($c[0]) >= 240 && ord($c[0]) <= 247) + return (ord($c[0])-240)*262144 + (ord($c[1])-128)*4096 + (ord($c[2])-128)*64 + (ord($c[3])-128); + if (ord($c[0]) >= 248 && ord($c[0]) <= 251) + return (ord($c[0])-248)*16777216 + (ord($c[1])-128)*262144 + (ord($c[2])-128)*4096 + (ord($c[3])-128)*64 + (ord($c[4])-128); + if (ord($c[0]) >= 252 && ord($c[0]) <= 253) + return (ord($c[0])-252)*1073741824 + (ord($c[1])-128)*16777216 + (ord($c[2])-128)*262144 + (ord($c[3])-128)*4096 + (ord($c[4])-128)*64 + (ord($c[5])-128); + if (ord($c[0]) >= 254 && ord($c[0]) <= 255) //error return PHPExcel_Calculation_Functions::VALUE(); return 0; } // function _uniord() diff --git a/libraries/PHPExcel/PHPExcel/Cell.php b/libraries/PHPExcel/PHPExcel/Cell.php index 9dd0794fb7cc06244297f089dfd8b61c3a809c2a..2d8f8034fb132a8de97b51c80f92dd85bd34d58b 100644 --- a/libraries/PHPExcel/PHPExcel/Cell.php +++ b/libraries/PHPExcel/PHPExcel/Cell.php @@ -703,10 +703,10 @@ class PHPExcel_Cell $_indexCache[$pString] = $_columnLookup[$pString]; return $_indexCache[$pString]; } elseif(!isset($pString{2})) { - $_indexCache[$pString] = $_columnLookup[$pString{0}] * 26 + $_columnLookup[$pString{1}]; + $_indexCache[$pString] = $_columnLookup[$pString[0]] * 26 + $_columnLookup[$pString[1]]; return $_indexCache[$pString]; } elseif(!isset($pString{3})) { - $_indexCache[$pString] = $_columnLookup[$pString{0}] * 676 + $_columnLookup[$pString{1}] * 26 + $_columnLookup[$pString{2}]; + $_indexCache[$pString] = $_columnLookup[$pString[0]] * 676 + $_columnLookup[$pString[1]] * 26 + $_columnLookup[$pString[2]]; return $_indexCache[$pString]; } } diff --git a/libraries/PHPExcel/PHPExcel/Cell/DefaultValueBinder.php b/libraries/PHPExcel/PHPExcel/Cell/DefaultValueBinder.php index 4799f78ccd1e030d789e6df80648fdcec66fefe4..9540076c0e8735a3a06dfaab6e37251f9d8a1128 100644 --- a/libraries/PHPExcel/PHPExcel/Cell/DefaultValueBinder.php +++ b/libraries/PHPExcel/PHPExcel/Cell/DefaultValueBinder.php @@ -83,7 +83,7 @@ class PHPExcel_Cell_DefaultValueBinder implements PHPExcel_Cell_IValueBinder } elseif ($pValue instanceof PHPExcel_RichText) { return PHPExcel_Cell_DataType::TYPE_INLINE; - } elseif ($pValue{0} === '=' && strlen($pValue) > 1) { + } elseif ($pValue[0] === '=' && strlen($pValue) > 1) { return PHPExcel_Cell_DataType::TYPE_FORMULA; } elseif (is_bool($pValue)) { diff --git a/libraries/PHPExcel/PHPExcel/Reader/Excel2003XML.php b/libraries/PHPExcel/PHPExcel/Reader/Excel2003XML.php index 022971ae0dc7a798221fc251282f0ff544527ba7..b20dee2aea6f29348041887d5cc18e28e0710d0d 100644 --- a/libraries/PHPExcel/PHPExcel/Reader/Excel2003XML.php +++ b/libraries/PHPExcel/PHPExcel/Reader/Excel2003XML.php @@ -803,12 +803,12 @@ class PHPExcel_Reader_Excel2003XML implements PHPExcel_Reader_IReader // Empty R reference is the current row if ($rowReference == '') $rowReference = $rowID; // Bracketed R references are relative to the current row - if ($rowReference{0} == '[') $rowReference = $rowID + trim($rowReference,'[]'); + if ($rowReference[0] == '[') $rowReference = $rowID + trim($rowReference,'[]'); $columnReference = $cellReference[4][0]; // Empty C reference is the current column if ($columnReference == '') $columnReference = $columnNumber; // Bracketed C references are relative to the current column - if ($columnReference{0} == '[') $columnReference = $columnNumber + trim($columnReference,'[]'); + if ($columnReference[0] == '[') $columnReference = $columnNumber + trim($columnReference,'[]'); $A1CellReference = PHPExcel_Cell::stringFromColumnIndex($columnReference-1).$rowReference; $value = substr_replace($value,$A1CellReference,$cellReference[0][1],strlen($cellReference[0][0])); } diff --git a/libraries/PHPExcel/PHPExcel/Reader/Excel5.php b/libraries/PHPExcel/PHPExcel/Reader/Excel5.php index 84a144fdd8cfe2b5ffb40eb14299a04eb1fdad6f..9f322640399de12534168bc674b58a42b9098a43 100644 --- a/libraries/PHPExcel/PHPExcel/Reader/Excel5.php +++ b/libraries/PHPExcel/PHPExcel/Reader/Excel5.php @@ -1740,7 +1740,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader // offset: 0; size: 2; 0 = base 1900, 1 = base 1904 PHPExcel_Shared_Date::setExcelCalendar(PHPExcel_Shared_Date::CALENDAR_WINDOWS_1900); - if (ord($recordData{0}) == 1) { + if (ord($recordData[0]) == 1) { PHPExcel_Shared_Date::setExcelCalendar(PHPExcel_Shared_Date::CALENDAR_MAC_1904); } } @@ -1799,7 +1799,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader } // offset: 10; size: 1; underline type - $underlineType = ord($recordData{10}); + $underlineType = ord($recordData[10]); switch ($underlineType) { case 0x00: break; // no underline @@ -1938,7 +1938,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader // offset: 6; size: 1; Alignment and text break // bit 2-0, mask 0x07; horizontal alignment - $horAlign = (0x07 & ord($recordData{6})) >> 0; + $horAlign = (0x07 & ord($recordData[6])) >> 0; switch ($horAlign) { case 0: $objStyle->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_GENERAL); @@ -1960,7 +1960,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader break; } // bit 3, mask 0x08; wrap text - $wrapText = (0x08 & ord($recordData{6})) >> 3; + $wrapText = (0x08 & ord($recordData[6])) >> 3; switch ($wrapText) { case 0: $objStyle->getAlignment()->setWrapText(false); @@ -1970,7 +1970,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader break; } // bit 6-4, mask 0x70; vertical alignment - $vertAlign = (0x70 & ord($recordData{6})) >> 4; + $vertAlign = (0x70 & ord($recordData[6])) >> 4; switch ($vertAlign) { case 0: $objStyle->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_TOP); @@ -1988,7 +1988,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader if ($this->_version == self::XLS_BIFF8) { // offset: 7; size: 1; XF_ROTATION: Text rotation angle - $angle = ord($recordData{7}); + $angle = ord($recordData[7]); $rotation = 0; if ($angle <= 90) { $rotation = $angle; @@ -2001,11 +2001,11 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader // offset: 8; size: 1; Indentation, shrink to cell size, and text direction // bit: 3-0; mask: 0x0F; indent level - $indent = (0x0F & ord($recordData{8})) >> 0; + $indent = (0x0F & ord($recordData[8])) >> 0; $objStyle->getAlignment()->setIndent($indent); // bit: 4; mask: 0x10; 1 = shrink content to fit into cell - $shrinkToFit = (0x10 & ord($recordData{8})) >> 4; + $shrinkToFit = (0x10 & ord($recordData[8])) >> 4; switch ($shrinkToFit) { case 0: $objStyle->getAlignment()->setShrinkToFit(false); @@ -2087,7 +2087,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader // BIFF5 // offset: 7; size: 1; Text orientation and flags - $orientationAndFlags = ord($recordData{7}); + $orientationAndFlags = ord($recordData[7]); // bit: 1-0; mask: 0x03; XF_ORIENTATION: Text orientation $xfOrientation = (0x03 & $orientationAndFlags) >> 0; @@ -2211,7 +2211,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader $xclrValue = substr($extData, 4, 4); // color value (value based on color type) if ($xclfType == 2) { - $rgb = sprintf('%02X%02X%02X', ord($xclrValue{0}), ord($xclrValue{1}), ord($xclrValue{2})); + $rgb = sprintf('%02X%02X%02X', ord($xclrValue[0]), ord($xclrValue[1]), ord($xclrValue[2])); // modify the relevant style property if ( isset($this->_mapCellXfIndex[$ixfe]) ) { @@ -2227,7 +2227,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader $xclrValue = substr($extData, 4, 4); // color value (value based on color type) if ($xclfType == 2) { - $rgb = sprintf('%02X%02X%02X', ord($xclrValue{0}), ord($xclrValue{1}), ord($xclrValue{2})); + $rgb = sprintf('%02X%02X%02X', ord($xclrValue[0]), ord($xclrValue[1]), ord($xclrValue[2])); // modify the relevant style property if ( isset($this->_mapCellXfIndex[$ixfe]) ) { @@ -2243,7 +2243,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader $xclrValue = substr($extData, 4, 4); // color value (value based on color type) if ($xclfType == 2) { - $rgb = sprintf('%02X%02X%02X', ord($xclrValue{0}), ord($xclrValue{1}), ord($xclrValue{2})); + $rgb = sprintf('%02X%02X%02X', ord($xclrValue[0]), ord($xclrValue[1]), ord($xclrValue[2])); // modify the relevant style property if ( isset($this->_mapCellXfIndex[$ixfe]) ) { @@ -2259,7 +2259,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader $xclrValue = substr($extData, 4, 4); // color value (value based on color type) if ($xclfType == 2) { - $rgb = sprintf('%02X%02X%02X', ord($xclrValue{0}), ord($xclrValue{1}), ord($xclrValue{2})); + $rgb = sprintf('%02X%02X%02X', ord($xclrValue[0]), ord($xclrValue[1]), ord($xclrValue[2])); // modify the relevant style property if ( isset($this->_mapCellXfIndex[$ixfe]) ) { @@ -2275,7 +2275,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader $xclrValue = substr($extData, 4, 4); // color value (value based on color type) if ($xclfType == 2) { - $rgb = sprintf('%02X%02X%02X', ord($xclrValue{0}), ord($xclrValue{1}), ord($xclrValue{2})); + $rgb = sprintf('%02X%02X%02X', ord($xclrValue[0]), ord($xclrValue[1]), ord($xclrValue[2])); // modify the relevant style property if ( isset($this->_mapCellXfIndex[$ixfe]) ) { @@ -2291,7 +2291,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader $xclrValue = substr($extData, 4, 4); // color value (value based on color type) if ($xclfType == 2) { - $rgb = sprintf('%02X%02X%02X', ord($xclrValue{0}), ord($xclrValue{1}), ord($xclrValue{2})); + $rgb = sprintf('%02X%02X%02X', ord($xclrValue[0]), ord($xclrValue[1]), ord($xclrValue[2])); // modify the relevant style property if ( isset($this->_mapCellXfIndex[$ixfe]) ) { @@ -2307,7 +2307,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader $xclrValue = substr($extData, 4, 4); // color value (value based on color type) if ($xclfType == 2) { - $rgb = sprintf('%02X%02X%02X', ord($xclrValue{0}), ord($xclrValue{1}), ord($xclrValue{2})); + $rgb = sprintf('%02X%02X%02X', ord($xclrValue[0]), ord($xclrValue[1]), ord($xclrValue[2])); // modify the relevant style property if ( isset($this->_mapCellXfIndex[$ixfe]) ) { @@ -2323,7 +2323,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader $xclrValue = substr($extData, 4, 4); // color value (value based on color type) if ($xclfType == 2) { - $rgb = sprintf('%02X%02X%02X', ord($xclrValue{0}), ord($xclrValue{1}), ord($xclrValue{2})); + $rgb = sprintf('%02X%02X%02X', ord($xclrValue[0]), ord($xclrValue[1]), ord($xclrValue[2])); // modify the relevant style property if ( isset($this->_mapCellXfIndex[$ixfe]) ) { @@ -2365,7 +2365,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader if ($isBuiltIn) { // offset: 2; size: 1; identifier for built-in style - $builtInId = ord($recordData{2}); + $builtInId = ord($recordData[2]); switch ($builtInId) { case 0x00: @@ -2431,7 +2431,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader $rec_offset = self::_GetInt4d($recordData, 0); // offset: 4; size: 1; sheet state - switch (ord($recordData{4})) { + switch (ord($recordData[4])) { case 0x00: $sheetState = PHPExcel_Worksheet::SHEETSTATE_VISIBLE; break; case 0x01: $sheetState = PHPExcel_Worksheet::SHEETSTATE_HIDDEN; break; case 0x02: $sheetState = PHPExcel_Worksheet::SHEETSTATE_VERYHIDDEN; break; @@ -2439,7 +2439,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader } // offset: 5; size: 1; sheet type - $sheetType = ord($recordData{5}); + $sheetType = ord($recordData[5]); // offset: 6; size: var; sheet name if ($this->_version == self::XLS_BIFF8) { @@ -2618,7 +2618,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader // offset: 2; size: 1; keyboard shortcut // offset: 3; size: 1; length of the name (character count) - $nlen = ord($recordData{3}); + $nlen = ord($recordData[3]); // offset: 4; size: 2; size of the formula data (it can happen that this is zero) // note: there can also be additional data, this is not included in $flen @@ -2702,7 +2702,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader $pos += 2; // option flags - $optionFlags = ord($recordData{$pos}); + $optionFlags = ord($recordData[$pos]); ++$pos; // bit: 0; mask: 0x01; 0 = compressed; 1 = uncompressed @@ -2771,7 +2771,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader // repeated option flags // OpenOffice.org documentation 5.21 - $option = ord($recordData{$pos}); + $option = ord($recordData[$pos]); ++$pos; if ($isCompressed && ($option == 0)) { @@ -2795,7 +2795,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader // this fragment compressed $len = min($charsLeft, $limitpos - $pos); for ($j = 0; $j < $len; ++$j) { - $retstr .= $recordData{$pos + $j} . chr(0); + $retstr .= $recordData[$pos + $j] . chr(0); } $charsLeft -= $len; $isCompressed = false; @@ -3694,7 +3694,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader // We can apparently not rely on $isPartOfSharedFormula. Even when $isPartOfSharedFormula = true // the formula data may be ordinary formula data, therefore we need to check // explicitly for the tExp token (0x01) - $isPartOfSharedFormula = $isPartOfSharedFormula && ord($formulaStructure{2}) == 0x01; + $isPartOfSharedFormula = $isPartOfSharedFormula && ord($formulaStructure[2]) == 0x01; if ($isPartOfSharedFormula) { // part of shared formula which means there will be a formula with a tExp token and nothing else @@ -3718,9 +3718,9 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader $xfIndex = self::_GetInt2d($recordData, 4); // offset: 6; size: 8; result of the formula - if ( (ord($recordData{6}) == 0) - && (ord($recordData{12}) == 255) - && (ord($recordData{13}) == 255) ) { + if ( (ord($recordData[6]) == 0) + && (ord($recordData[12]) == 255) + && (ord($recordData[13]) == 255) ) { // String formula. Result follows in appended STRING record $dataType = PHPExcel_Cell_DataType::TYPE_STRING; @@ -3734,25 +3734,25 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader // read STRING record $value = $this->_readString(); - } elseif ((ord($recordData{6}) == 1) - && (ord($recordData{12}) == 255) - && (ord($recordData{13}) == 255)) { + } elseif ((ord($recordData[6]) == 1) + && (ord($recordData[12]) == 255) + && (ord($recordData[13]) == 255)) { // Boolean formula. Result is in +2; 0=false, 1=true $dataType = PHPExcel_Cell_DataType::TYPE_BOOL; - $value = (bool) ord($recordData{8}); + $value = (bool) ord($recordData[8]); - } elseif ((ord($recordData{6}) == 2) - && (ord($recordData{12}) == 255) - && (ord($recordData{13}) == 255)) { + } elseif ((ord($recordData[6]) == 2) + && (ord($recordData[12]) == 255) + && (ord($recordData[13]) == 255)) { // Error formula. Error code is in +2 $dataType = PHPExcel_Cell_DataType::TYPE_ERROR; - $value = self::_mapErrorCode(ord($recordData{8})); + $value = self::_mapErrorCode(ord($recordData[8])); - } elseif ((ord($recordData{6}) == 3) - && (ord($recordData{12}) == 255) - && (ord($recordData{13}) == 255)) { + } elseif ((ord($recordData[6]) == 3) + && (ord($recordData[12]) == 255) + && (ord($recordData[13]) == 255)) { // Formula result is a null string $dataType = PHPExcel_Cell_DataType::TYPE_NULL; @@ -3820,7 +3820,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader // offset: 6, size: 1; not used // offset: 7, size: 1; number of existing FORMULA records for this shared formula - $no = ord($recordData{7}); + $no = ord($recordData[7]); // offset: 8, size: var; Binary token array of the shared formula $formula = substr($recordData, 8); @@ -3887,10 +3887,10 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader $xfIndex = self::_GetInt2d($recordData, 4); // offset: 6; size: 1; the boolean value or error value - $boolErr = ord($recordData{6}); + $boolErr = ord($recordData[6]); // offset: 7; size: 1; 0=boolean; 1=error - $isError = ord($recordData{7}); + $isError = ord($recordData[7]); $cell = $this->_phpSheet->getCell($columnString . ($row + 1)); switch ($isError) { @@ -4198,7 +4198,7 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader if (!$this->_readDataOnly) { // offset: 0; size: 1; pane identifier - $paneId = ord($recordData{0}); + $paneId = ord($recordData[0]); // offset: 1; size: 2; index to row of the active cell $r = self::_GetInt2d($recordData, 1); @@ -4349,9 +4349,9 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader $hyperlinkType = 'UNC'; } else if (!$isFileLinkOrUrl) { $hyperlinkType = 'workbook'; - } else if (ord($recordData{$offset}) == 0x03) { + } else if (ord($recordData[$offset]) == 0x03) { $hyperlinkType = 'local'; - } else if (ord($recordData{$offset}) == 0xE0) { + } else if (ord($recordData[$offset]) == 0xE0) { $hyperlinkType = 'URL'; } @@ -5896,10 +5896,10 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader $lr = self::_GetInt2d($subData, 2) + 1; // offset: 4; size: 1; index to first column - $fc = ord($subData{4}); + $fc = ord($subData[4]); // offset: 5; size: 1; index to last column - $lc = ord($subData{5}); + $lc = ord($subData[5]); // check values if ($fr > $lr || $fc > $lc) { @@ -6306,13 +6306,13 @@ class PHPExcel_Reader_Excel5 implements PHPExcel_Reader_IReader private static function _readRGB($rgb) { // offset: 0; size 1; Red component - $r = ord($rgb{0}); + $r = ord($rgb[0]); // offset: 1; size: 1; Green component - $g = ord($rgb{1}); + $g = ord($rgb[1]); // offset: 2; size: 1; Blue component - $b = ord($rgb{2}); + $b = ord($rgb[2]); // HEX notation, e.g. 'FF00FC' $rgb = sprintf('%02X%02X%02X', $r, $g, $b); diff --git a/libraries/PHPExcel/PHPExcel/Reader/Excel5/Escher.php b/libraries/PHPExcel/PHPExcel/Reader/Excel5/Escher.php index c7dc35c10ec95560208333aab9915ef356fd473e..4453dcf4125ff274ac4a5e57378e5292c75f1e6c 100644 --- a/libraries/PHPExcel/PHPExcel/Reader/Excel5/Escher.php +++ b/libraries/PHPExcel/PHPExcel/Reader/Excel5/Escher.php @@ -250,16 +250,16 @@ class PHPExcel_Reader_Excel5_Escher $foDelay = PHPExcel_Reader_Excel5::_GetInt4d($recordData, 28); // offset: 32; size: 1; unused1 - $unused1 = ord($recordData{32}); + $unused1 = ord($recordData[32]); // offset: 33; size: 1; size of nameData in bytes (including null terminator) - $cbName = ord($recordData{33}); + $cbName = ord($recordData[33]); // offset: 34; size: 1; unused2 - $unused2 = ord($recordData{34}); + $unused2 = ord($recordData[34]); // offset: 35; size: 1; unused3 - $unused3 = ord($recordData{35}); + $unused3 = ord($recordData[35]); // offset: 36; size: $cbName; nameData $nameData = substr($recordData, 36, $cbName); @@ -301,7 +301,7 @@ class PHPExcel_Reader_Excel5_Escher } // offset: var; size: 1; tag - $tag = ord($recordData{$pos}); + $tag = ord($recordData[$pos]); $pos += 1; // offset: var; size: var; the raw image data @@ -342,7 +342,7 @@ class PHPExcel_Reader_Excel5_Escher } // offset: var; size: 1; tag - $tag = ord($recordData{$pos}); + $tag = ord($recordData[$pos]); $pos += 1; // offset: var; size: var; the raw image data diff --git a/libraries/PHPExcel/PHPExcel/Reader/SYLK.php b/libraries/PHPExcel/PHPExcel/Reader/SYLK.php index 6a6bad46a0168d8fabf524615eded35f28628cf2..a6f6431a37620d7f0f17358fa4e3cee0dfbf861a 100644 --- a/libraries/PHPExcel/PHPExcel/Reader/SYLK.php +++ b/libraries/PHPExcel/PHPExcel/Reader/SYLK.php @@ -212,7 +212,7 @@ class PHPExcel_Reader_SYLK implements PHPExcel_Reader_IReader if ($dataType == 'C') { // Read cell value data foreach($rowData as $rowDatum) { - switch($rowDatum{0}) { + switch($rowDatum[0]) { case 'C' : case 'X' : $columnIndex = substr($rowDatum,1) - 1; @@ -305,7 +305,7 @@ class PHPExcel_Reader_SYLK implements PHPExcel_Reader_IReader if ($dataType == 'P') { $formatArray = array(); foreach($rowData as $rowDatum) { - switch($rowDatum{0}) { + switch($rowDatum[0]) { case 'P' : $formatArray['numberformat']['code'] = str_replace($fromFormats,$toFormats,substr($rowDatum,1)); break; case 'E' : @@ -315,7 +315,7 @@ class PHPExcel_Reader_SYLK implements PHPExcel_Reader_IReader break; case 'S' : $styleSettings = substr($rowDatum,1); for ($i=0;$i<strlen($styleSettings);++$i) { - switch ($styleSettings{$i}) { + switch ($styleSettings[$i]) { case 'I' : $formatArray['font']['italic'] = true; break; case 'D' : $formatArray['font']['bold'] = true; @@ -339,7 +339,7 @@ class PHPExcel_Reader_SYLK implements PHPExcel_Reader_IReader $hasCalculatedValue = false; $cellData = $cellDataFormula = ''; foreach($rowData as $rowDatum) { - switch($rowDatum{0}) { + switch($rowDatum[0]) { case 'C' : case 'X' : $column = substr($rowDatum,1); break; @@ -367,12 +367,12 @@ class PHPExcel_Reader_SYLK implements PHPExcel_Reader_IReader // Empty R reference is the current row if ($rowReference == '') $rowReference = $row; // Bracketed R references are relative to the current row - if ($rowReference{0} == '[') $rowReference = $row + trim($rowReference,'[]'); + if ($rowReference[0] == '[') $rowReference = $row + trim($rowReference,'[]'); $columnReference = $cellReference[4][0]; // Empty C reference is the current column if ($columnReference == '') $columnReference = $column; // Bracketed C references are relative to the current column - if ($columnReference{0} == '[') $columnReference = $column + trim($columnReference,'[]'); + if ($columnReference[0] == '[') $columnReference = $column + trim($columnReference,'[]'); $A1CellReference = PHPExcel_Cell::stringFromColumnIndex($columnReference-1).$rowReference; $value = substr_replace($value,$A1CellReference,$cellReference[0][1],strlen($cellReference[0][0])); @@ -400,7 +400,7 @@ class PHPExcel_Reader_SYLK implements PHPExcel_Reader_IReader $formatStyle = $columnWidth = $styleSettings = ''; $styleData = array(); foreach($rowData as $rowDatum) { - switch($rowDatum{0}) { + switch($rowDatum[0]) { case 'C' : case 'X' : $column = substr($rowDatum,1); break; @@ -413,7 +413,7 @@ class PHPExcel_Reader_SYLK implements PHPExcel_Reader_IReader break; case 'S' : $styleSettings = substr($rowDatum,1); for ($i=0;$i<strlen($styleSettings);++$i) { - switch ($styleSettings{$i}) { + switch ($styleSettings[$i]) { case 'I' : $styleData['font']['italic'] = true; break; case 'D' : $styleData['font']['bold'] = true; @@ -454,7 +454,7 @@ class PHPExcel_Reader_SYLK implements PHPExcel_Reader_IReader } } else { foreach($rowData as $rowDatum) { - switch($rowDatum{0}) { + switch($rowDatum[0]) { case 'C' : case 'X' : $column = substr($rowDatum,1); break; diff --git a/libraries/PHPExcel/PHPExcel/ReferenceHelper.php b/libraries/PHPExcel/PHPExcel/ReferenceHelper.php index b22daa0df410ac8bad32beed7fdfb1c115990913..90ac38ccc14e904809e54b4e5552c75ed5d9f624 100644 --- a/libraries/PHPExcel/PHPExcel/ReferenceHelper.php +++ b/libraries/PHPExcel/PHPExcel/ReferenceHelper.php @@ -598,10 +598,10 @@ class PHPExcel_ReferenceHelper list($newColumn, $newRow) = PHPExcel_Cell::coordinateFromString( $pCellReference ); // Verify which parts should be updated - $updateColumn = (($newColumn{0} != '$') && ($beforeColumn{0} != '$') && + $updateColumn = (($newColumn[0] != '$') && ($beforeColumn[0] != '$') && PHPExcel_Cell::columnIndexFromString($newColumn) >= PHPExcel_Cell::columnIndexFromString($beforeColumn)); - $updateRow = (($newRow{0} != '$') && ($beforeRow{0} != '$') && + $updateRow = (($newRow[0] != '$') && ($beforeRow[0] != '$') && $newRow >= $beforeRow); // Create new column reference diff --git a/libraries/PHPExcel/PHPExcel/Shared/OLE.php b/libraries/PHPExcel/PHPExcel/Shared/OLE.php index a5c8dd1d000e828729612f9b9f6cd9bb409e5c51..3e0af0162cb2c64873fcf5291ffe90da158607bc 100644 --- a/libraries/PHPExcel/PHPExcel/Shared/OLE.php +++ b/libraries/PHPExcel/PHPExcel/Shared/OLE.php @@ -447,7 +447,7 @@ class PHPExcel_Shared_OLE { $rawname = ''; for ($i = 0; $i < strlen($ascii); ++$i) { - $rawname .= $ascii{$i} . "\x00"; + $rawname .= $ascii[$i] . "\x00"; } return $rawname; } diff --git a/libraries/PHPExcel/PHPExcel/Shared/String.php b/libraries/PHPExcel/PHPExcel/Shared/String.php index a0a6eaeaac42ef9c63ad9140415cd6d8c3cb473b..e78f406c1cc4b390f4f4c2f443f72e17ef2b4ec8 100644 --- a/libraries/PHPExcel/PHPExcel/Shared/String.php +++ b/libraries/PHPExcel/PHPExcel/Shared/String.php @@ -527,15 +527,15 @@ class PHPExcel_Shared_String */ public static function utf16_decode( $str, $bom_be=true ) { if( strlen($str) < 2 ) return $str; - $c0 = ord($str{0}); - $c1 = ord($str{1}); + $c0 = ord($str[0]); + $c1 = ord($str[1]); if( $c0 == 0xfe && $c1 == 0xff ) { $str = substr($str,2); } elseif( $c0 == 0xff && $c1 == 0xfe ) { $str = substr($str,2); $bom_be = false; } $len = strlen($str); $newstr = ''; for($i=0;$i<$len;$i+=2) { - if( $bom_be ) { $val = ord($str{$i}) << 4; $val += ord($str{$i+1}); } - else { $val = ord($str{$i+1}) << 4; $val += ord($str{$i}); } + if( $bom_be ) { $val = ord($str[$i]) << 4; $val += ord($str[$i+1]); } + else { $val = ord($str[$i+1]) << 4; $val += ord($str[$i]); } $newstr .= ($val == 0x228) ? "\n" : chr($val); } return $newstr; diff --git a/libraries/PHPExcel/PHPExcel/Shared/ZipStreamWrapper.php b/libraries/PHPExcel/PHPExcel/Shared/ZipStreamWrapper.php index 8e9259ea59a5b3242eae905a2744b3c001d29e99..1a81e9f627bb621e9482e82185bcc429480ecda8 100644 --- a/libraries/PHPExcel/PHPExcel/Shared/ZipStreamWrapper.php +++ b/libraries/PHPExcel/PHPExcel/Shared/ZipStreamWrapper.php @@ -81,7 +81,7 @@ class PHPExcel_Shared_ZipStreamWrapper { */ public function stream_open($path, $mode, $options, &$opened_path) { // Check for mode - if ($mode{0} != 'r') { + if ($mode[0] != 'r') { throw new Exception('Mode ' . $mode . ' is not supported. Only read mode is supported.'); } diff --git a/libraries/PHPExcel/PHPExcel/Writer/Excel5/Parser.php b/libraries/PHPExcel/PHPExcel/Writer/Excel5/Parser.php index 186259c50b91610c75b534ae90acbc0d9460baf9..18626254439a6a0ba30a1383a8f5bc033daed293 100644 --- a/libraries/PHPExcel/PHPExcel/Writer/Excel5/Parser.php +++ b/libraries/PHPExcel/PHPExcel/Writer/Excel5/Parser.php @@ -1022,7 +1022,7 @@ class PHPExcel_Writer_Excel5_Parser $col = 0; $col_ref_length = strlen($col_ref); for ($i = 0; $i < $col_ref_length; ++$i) { - $col += (ord($col_ref{$i}) - 64) * pow(26, $expn); + $col += (ord($col_ref[$i]) - 64) * pow(26, $expn); --$expn; } @@ -1044,21 +1044,21 @@ class PHPExcel_Writer_Excel5_Parser $formula_length = strlen($this->_formula); // eat up white spaces if ($i < $formula_length) { - while ($this->_formula{$i} == " ") { + while ($this->_formula[$i] == " ") { ++$i; } if ($i < ($formula_length - 1)) { - $this->_lookahead = $this->_formula{$i+1}; + $this->_lookahead = $this->_formula[$i+1]; } $token = ''; } while ($i < $formula_length) { - $token .= $this->_formula{$i}; + $token .= $this->_formula[$i]; if ($i < ($formula_length - 1)) { - $this->_lookahead = $this->_formula{$i+1}; + $this->_lookahead = $this->_formula[$i+1]; } else { $this->_lookahead = ''; } @@ -1073,7 +1073,7 @@ class PHPExcel_Writer_Excel5_Parser } if ($i < ($formula_length - 2)) { - $this->_lookahead = $this->_formula{$i+2}; + $this->_lookahead = $this->_formula[$i+2]; } else { // if we run out of characters _lookahead becomes empty $this->_lookahead = ''; } @@ -1206,7 +1206,7 @@ class PHPExcel_Writer_Excel5_Parser { $this->_current_char = 0; $this->_formula = $formula; - $this->_lookahead = isset($formula{1}) ? $formula{1} : ''; + $this->_lookahead = isset($formula[1]) ? $formula[1] : ''; $this->_advance(); $this->_parse_tree = $this->_condition(); return true; diff --git a/libraries/PHPExcel/PHPExcel/Writer/Excel5/Workbook.php b/libraries/PHPExcel/PHPExcel/Writer/Excel5/Workbook.php index 95b3b86f15d8ee71261456a28c4f1bfa79062c26..86e3fe03a989525b529f52ba3816ba6d8d021d86 100644 --- a/libraries/PHPExcel/PHPExcel/Writer/Excel5/Workbook.php +++ b/libraries/PHPExcel/PHPExcel/Writer/Excel5/Workbook.php @@ -674,7 +674,7 @@ class PHPExcel_Writer_Excel5_Workbook extends PHPExcel_Writer_Excel5_BIFFwriter $formulaData = $this->_parser->toReversePolish(); // make sure tRef3d is of type tRef3dR (0x3A) - if (isset($formulaData{0}) and ($formulaData{0} == "\x7A" or $formulaData{0} == "\x5A")) { + if (isset($formulaData[0]) and ($formulaData[0] == "\x7A" or $formulaData[0] == "\x5A")) { $formulaData = "\x3A" . substr($formulaData, 1); } diff --git a/libraries/PHPExcel/PHPExcel/Writer/Excel5/Worksheet.php b/libraries/PHPExcel/PHPExcel/Writer/Excel5/Worksheet.php index 47c88400b51e69e07a6c87667b0eb8bd0421cf93..0fff9c6f8a35c7ce73fef50497aec7592056549b 100644 --- a/libraries/PHPExcel/PHPExcel/Writer/Excel5/Worksheet.php +++ b/libraries/PHPExcel/PHPExcel/Writer/Excel5/Worksheet.php @@ -866,7 +866,7 @@ class PHPExcel_Writer_Excel5_Worksheet extends PHPExcel_Writer_Excel5_BIFFwriter $unknown = 0x0000; // Must be zero // Strip the '=' or '@' sign at the beginning of the formula string - if ($formula{0} == '=') { + if ($formula[0] == '=') { $formula = substr($formula,1); } else { // Error handling diff --git a/libraries/PHPMarkdown/Michelf/Markdown.php b/libraries/PHPMarkdown/Michelf/Markdown.php index 5e426063d8ab81b9151d48158b37f9ceaae6b07d..93df29ec7e74e56b279b69b339e98a7fd4d7521d 100644 --- a/libraries/PHPMarkdown/Michelf/Markdown.php +++ b/libraries/PHPMarkdown/Michelf/Markdown.php @@ -774,7 +774,7 @@ class Markdown implements MarkdownInterface { if ($matches[2] == '-' && preg_match('{^-(?: |$)}', $matches[1])) return $matches[0]; - $level = $matches[2]{0} == '=' ? 1 : 2; + $level = $matches[2][0] == '=' ? 1 : 2; $block = "<h$level>".$this->runSpanGamut($matches[1])."</h$level>"; return "\n" . $this->hashBlock($block) . "\n\n"; } @@ -1069,7 +1069,7 @@ class Markdown implements MarkdownInterface { } else { # Other closing marker: close one em or strong and # change current token state to match the other - $token_stack[0] = str_repeat($token{0}, 3-$token_len); + $token_stack[0] = str_repeat($token[0], 3-$token_len); $tag = $token_len == 2 ? "strong" : "em"; $span = $text_stack[0]; $span = $this->runSpanGamut($span); @@ -1094,7 +1094,7 @@ class Markdown implements MarkdownInterface { } else { # Reached opening three-char emphasis marker. Push on token # stack; will be handled by the special condition above. - $em = $token{0}; + $em = $token[0]; $strong = "$em$em"; array_unshift($token_stack, $token); array_unshift($text_stack, ''); @@ -1435,9 +1435,9 @@ class Markdown implements MarkdownInterface { # Handle $token provided by parseSpan by determining its nature and # returning the corresponding value that should replace it. # - switch ($token{0}) { + switch ($token[0]) { case "\\": - return $this->hashPart("&#". ord($token{1}). ";"); + return $this->hashPart("&#". ord($token[1]). ";"); case "`": # Search for end marker in remaining text. if (preg_match('/^(.*?[^`])'.preg_quote($token).'(?!`)(.*)$/sm', @@ -1671,9 +1671,9 @@ abstract class _MarkdownExtra_TmpImpl extends \Michelf\Markdown { $classes = array(); $id = false; foreach ($elements as $element) { - if ($element{0} == '.') { + if ($element[0] == '.') { $classes[] = substr($element, 1); - } else if ($element{0} == '#') { + } else if ($element[0] == '#') { if ($id === false) $id = substr($element, 1); } } @@ -1936,7 +1936,7 @@ abstract class _MarkdownExtra_TmpImpl extends \Michelf\Markdown { # # Check for: Indented code block. # - else if ($tag{0} == "\n" || $tag{0} == " ") { + else if ($tag[0] == "\n" || $tag[0] == " ") { # Indented code block: pass it unchanged, will be handled # later. $parsed .= $tag; @@ -1945,7 +1945,7 @@ abstract class _MarkdownExtra_TmpImpl extends \Michelf\Markdown { # Check for: Code span marker # Note: need to check this after backtick fenced code blocks # - else if ($tag{0} == "`") { + else if ($tag[0] == "`") { # Find corresponding end marker. $tag_re = preg_quote($tag); if (preg_match('{^(?>.+?|\n(?!\n))*?(?<!`)'.$tag_re.'(?!`)}', @@ -1983,7 +1983,7 @@ abstract class _MarkdownExtra_TmpImpl extends \Michelf\Markdown { # HTML Comments, processing instructions. # else if (preg_match('{^<(?:'.$this->clean_tags_re.')\b}', $tag) || - $tag{1} == '!' || $tag{1} == '?') + $tag[1] == '!' || $tag[1] == '?') { # Need to parse tag and following text using the HTML parser. # (don't check for markdown attribute) @@ -2002,8 +2002,8 @@ abstract class _MarkdownExtra_TmpImpl extends \Michelf\Markdown { # # Increase/decrease nested tag count. # - if ($tag{1} == '/') $depth--; - else if ($tag{strlen($tag)-2} != '/') $depth++; + if ($tag[1] == '/') $depth--; + else if ($tag[strlen($tag)-2] != '/') $depth++; if ($depth < 0) { # @@ -2107,7 +2107,7 @@ abstract class _MarkdownExtra_TmpImpl extends \Michelf\Markdown { # first character as filtered to prevent an infinite loop in the # parent function. # - return array($original_text{0}, substr($original_text, 1)); + return array($original_text[0], substr($original_text, 1)); } $block_text .= $parts[0]; # Text before current tag. @@ -2119,7 +2119,7 @@ abstract class _MarkdownExtra_TmpImpl extends \Michelf\Markdown { # Comments and Processing Instructions. # if (preg_match('{^</?(?:'.$this->auto_close_tags_re.')\b}', $tag) || - $tag{1} == '!' || $tag{1} == '?') + $tag[1] == '!' || $tag[1] == '?') { # Just add the tag to the block as if it was text. $block_text .= $tag; @@ -2130,8 +2130,8 @@ abstract class _MarkdownExtra_TmpImpl extends \Michelf\Markdown { # the tag's name match base tag's. # if (preg_match('{^</?'.$base_tag_name_re.'\b}', $tag)) { - if ($tag{1} == '/') $depth--; - else if ($tag{strlen($tag)-2} != '/') $depth++; + if ($tag[1] == '/') $depth--; + else if ($tag[strlen($tag)-2] != '/') $depth++; } # @@ -2494,7 +2494,7 @@ abstract class _MarkdownExtra_TmpImpl extends \Michelf\Markdown { protected function _doHeaders_callback_setext($matches) { if ($matches[3] == '-' && preg_match('{^- }', $matches[1])) return $matches[0]; - $level = $matches[3]{0} == '=' ? 1 : 2; + $level = $matches[3][0] == '=' ? 1 : 2; $attr = $this->doExtraAttributes("h$level", $dummy =& $matches[2]); $block = "<h$level$attr>".$this->runSpanGamut($matches[1])."</h$level>"; return "\n" . $this->hashBlock($block) . "\n\n"; @@ -2824,7 +2824,7 @@ abstract class _MarkdownExtra_TmpImpl extends \Michelf\Markdown { array($this, '_doFencedCodeBlocks_newlines'), $codeblock); if ($classname != "") { - if ($classname{0} == '.') + if ($classname[0] == '.') $classname = substr($classname, 1); $attr_str = ' class="'.$this->code_class_prefix.$classname.'"'; } else { diff --git a/libraries/google-api-php-client/src/Google/Utils.php b/libraries/google-api-php-client/src/Google/Utils.php index f5ef32cd4d6f72d106007a065d09ba9fb5f6efef..6c342d2d3b84eba12d6727f299200b58c6c3d21c 100644 --- a/libraries/google-api-php-client/src/Google/Utils.php +++ b/libraries/google-api-php-client/src/Google/Utils.php @@ -64,7 +64,7 @@ class Google_Utils $strlenVar = strlen($str); $d = $ret = 0; for ($count = 0; $count < $strlenVar; ++ $count) { - $ordinalValue = ord($str{$ret}); + $ordinalValue = ord($str[$ret]); switch (true) { case (($ordinalValue >= 0x20) && ($ordinalValue <= 0x7F)): // characters U-00000000 - U-0000007F (same as ASCII) diff --git a/libraries/htmlpurifier410/library/HTMLPurifier.autoload-legacy.php b/libraries/htmlpurifier410/library/HTMLPurifier.autoload-legacy.php index d2ea83f451f6b1ba327dd366329cf7ef8680a2ee..fb6418d38b617a57748784761ec47f51fa822ff5 100644 --- a/libraries/htmlpurifier410/library/HTMLPurifier.autoload-legacy.php +++ b/libraries/htmlpurifier410/library/HTMLPurifier.autoload-legacy.php @@ -7,9 +7,9 @@ * Must be separate to prevent deprecation warning on PHP 7.2 */ -function __autoload($class) +spl_autoload_register(function($class) { return HTMLPurifier_Bootstrap::autoload($class); -} +}); // vim: et sw=4 sts=4 diff --git a/libraries/htmlpurifier410/library/HTMLPurifier/ChildDef/Custom.php b/libraries/htmlpurifier410/library/HTMLPurifier/ChildDef/Custom.php index 1047cd8e8b9427d89297bc302a625440adb86d6b..cc84d89908182c20e6f518931a020c3ff2d38330 100644 --- a/libraries/htmlpurifier410/library/HTMLPurifier/ChildDef/Custom.php +++ b/libraries/htmlpurifier410/library/HTMLPurifier/ChildDef/Custom.php @@ -45,7 +45,7 @@ class HTMLPurifier_ChildDef_Custom extends HTMLPurifier_ChildDef protected function _compileRegex() { $raw = str_replace(' ', '', $this->dtd_regex); - if ($raw{0} != '(') { + if ($raw[0] != '(') { $raw = "($raw)"; } $el = '[#a-zA-Z0-9_.-]+'; diff --git a/libraries/nusoap/class.soapclient.php b/libraries/nusoap/class.soapclient.php index 9c0fd3fa24b6cd290e62c0627cdf05111e8192b0..a8db2b2d97242f5e2a9e2ce1e2de52a543286a16 100644 --- a/libraries/nusoap/class.soapclient.php +++ b/libraries/nusoap/class.soapclient.php @@ -111,7 +111,7 @@ class soapclient2 extends nusoap_base { // instantiate wsdl object and parse wsdl file $this->debug('instantiating wsdl class with doc: '.$endpoint); - $this->wsdl =& new wsdl($this->wsdlFile,$this->proxyhost,$this->proxyport,$this->proxyusername,$this->proxypassword,$this->timeout,$this->response_timeout); + $this->wsdl = new wsdl($this->wsdlFile,$this->proxyhost,$this->proxyport,$this->proxyusername,$this->proxypassword,$this->timeout,$this->response_timeout); } $this->appendDebug($this->wsdl->getDebug()); $this->wsdl->clearDebug(); diff --git a/libraries/nusoap/nusoapmime.php b/libraries/nusoap/nusoapmime.php index 85b2363eb63d3079433aa5da3f8de624ad209eb6..e27200eb90607aa8fa5c7f978a5b5c1be1246990 100644 --- a/libraries/nusoap/nusoapmime.php +++ b/libraries/nusoap/nusoapmime.php @@ -127,7 +127,7 @@ class soapclient2mime extends soapclient2 { function getHTTPBody($soapmsg) { if (count($this->requestAttachments) > 0) { $params['content_type'] = 'multipart/related; type=text/xml'; - $mimeMessage =& new Mail_mimePart('', $params); + $mimeMessage = new Mail_mimePart('', $params); unset($params); $params['content_type'] = 'text/xml'; @@ -347,7 +347,7 @@ class nusoapservermime extends soap_server { function getHTTPBody($soapmsg) { if (count($this->responseAttachments) > 0) { $params['content_type'] = 'multipart/related; type=text/xml'; - $mimeMessage =& new Mail_mimePart('', $params); + $mimeMessage = new Mail_mimePart('', $params); unset($params); $params['content_type'] = 'text/xml'; diff --git a/modules/Calendar/iCal/iCalendar_properties.php b/modules/Calendar/iCal/iCalendar_properties.php index b1f320361ab2535583928cc3e148d83a8e3976ba..d49ba55dde381bb6c72782023d29f8957fecc348 100644 --- a/modules/Calendar/iCal/iCalendar_properties.php +++ b/modules/Calendar/iCal/iCalendar_properties.php @@ -702,7 +702,7 @@ class iCalendar_property_duration extends iCalendar_property { } // Value must be positive - return ($value{0} != '-'); + return ($value[0] != '-'); } } @@ -725,11 +725,11 @@ class iCalendar_property_freebusy extends iCalendar_property { } $pos = strpos($value, '/'); // We know there's only one / in there - if($value{$pos - 1} != 'Z') { + if($value[$pos - 1] != 'Z') { // Start time MUST be in UTC return false; } - if($value{$pos + 1} != 'P' && $substr($value, -1) != 'Z') { + if($value[$pos + 1] != 'P' && $substr($value, -1) != 'Z') { // If the second part is not a period, it MUST be in UTC return false; } @@ -1162,13 +1162,13 @@ class iCalendar_property_request_status extends iCalendar_property { $escch = false; for($i = 0; $i < $len; ++$i) { - if($value{$i} == ';' && !$escch) { + if($value[$i] == ';' && !$escch) { // Token completed $parts[] = substr($value, $from, $i - $from); $from = $i + 1; continue; } - $escch = ($value{$i} == '\\'); + $escch = ($value[$i] == '\\'); } // Add one last token with the remaining text; if the value // ended with a ';' it was illegal, so check that this token @@ -1189,23 +1189,23 @@ class iCalendar_property_request_status extends iCalendar_property { return false; } - if($parts[0]{0} < '1' || $parts[0]{0} > '4') { + if($parts[0][0] < '1' || $parts[0][0] > '4') { return false; } $len = strlen($parts[0]); // Max 3 levels, and can't end with a period - if($len > 5 || $parts[0]{$len - 1} == '.') { + if($len > 5 || $parts[0][$len - 1] == '.') { return false; } for($i = 1; $i < $len; ++$i) { - if(($i & 1) == 1 && $parts[0]{$i} != '.') { + if(($i & 1) == 1 && $parts[0][$i] != '.') { // Even-indexed chars must be periods return false; } - else if(($i & 1) == 0 && ($parts[0]{$i} < '0' || $parts[0]{$i} > '9')) { + else if(($i & 1) == 0 && ($parts[0][$i] < '0' || $parts[0][$i] > '9')) { // Odd-indexed chars must be numbers return false; } @@ -1229,8 +1229,8 @@ class iCalendar_property_request_status extends iCalendar_property { $parts[$i] .= '#'; // This guard token saves some conditionals in the loop for($j = 0; $j < $len; ++$j) { - $thischar = $parts[$i]{$j}; - $nextchar = $parts[$i]{$j + 1}; + $thischar = $parts[$i][$j]; + $nextchar = $parts[$i][$j + 1]; if($thischar == '\\') { // Next char must now be one of ";,\nN" if($nextchar != ';' && $nextchar != ',' && $nextchar != '\\' && diff --git a/modules/Calendar/iCal/iCalendar_rfc2445.php b/modules/Calendar/iCal/iCalendar_rfc2445.php index e3b168cb911fb38a163866ed387c8a4cb373833e..ab3735e974e7399ff3feca9b673eebbf95b6aeee 100644 --- a/modules/Calendar/iCal/iCalendar_rfc2445.php +++ b/modules/Calendar/iCal/iCalendar_rfc2445.php @@ -131,7 +131,7 @@ function rfc2445_is_valid_value($value, $type) { } for($i = 0; $i < $len; ++$i) { - $ch = $value{$i}; + $ch = $value[$i]; if(!($ch >= 'a' && $ch <= 'z' || $ch >= 'A' && $ch <= 'Z' || $ch >= '0' && $ch <= '9' || $ch == '-' || $ch == '+')) { if($ch == '=' && $len - $i <= 2) { continue; @@ -180,7 +180,7 @@ function rfc2445_is_valid_value($value, $type) { return false; } - return($value{8} == 'T' && + return($value[8] == 'T' && rfc2445_is_valid_value(substr($value, 0, 8), RFC2445_TYPE_DATE) && rfc2445_is_valid_value(substr($value, 9), RFC2445_TYPE_TIME)); break; @@ -197,12 +197,12 @@ function rfc2445_is_valid_value($value, $type) { return false; } - if($value{0} == '+' || $value{0} == '-') { + if($value[0] == '+' || $value[0] == '-') { $value = substr($value, 1); --$len; // Don't forget to update this! } - if($value{0} != 'P') { + if($value[0] != 'P') { return false; } @@ -211,7 +211,7 @@ function rfc2445_is_valid_value($value, $type) { $allowed = 'WDT'; for($i = 1; $i < $len; ++$i) { - $ch = $value{$i}; + $ch = $value[$i]; if($ch >= '0' && $ch <= '9') { $num .= $ch; continue; @@ -278,7 +278,7 @@ function rfc2445_is_valid_value($value, $type) { $int = false; $len = strlen($value); for($i = 0; $i < $len; ++$i) { - switch($value{$i}) { + switch($value[$i]) { case '-': case '+': // A sign can only be seen at position 0 and cannot be the only char if($i != 0 || $len == 1) { @@ -318,7 +318,7 @@ function rfc2445_is_valid_value($value, $type) { return false; } - if($value{0} == '+' || $value{0} == '-') { + if($value[0] == '+' || $value[0] == '-') { if(strlen($value) == 1) { return false; } @@ -353,7 +353,7 @@ function rfc2445_is_valid_value($value, $type) { } else if(rfc2445_is_valid_value($parts[1], RFC2445_TYPE_DURATION)) { // The period MUST NOT be negative - return ($parts[1]{0} != '-'); + return ($parts[1][0] != '-'); } // It seems to be illegal @@ -720,7 +720,7 @@ function rfc2445_is_valid_value($value, $type) { return false; } - if($value{0} != '+' && $value{0} != '-') { + if($value[0] != '+' && $value[0] != '-') { return false; } diff --git a/pkg/vtiger/modules/MailManager/modules/MailManager/third-party/HTML.Safe.php b/pkg/vtiger/modules/MailManager/modules/MailManager/third-party/HTML.Safe.php index 3155119d168096c42fd2ee1125509e55803348ea..8855f7a04e8027ae7c17a4aafab3d9fa8d898bfe 100644 --- a/pkg/vtiger/modules/MailManager/modules/MailManager/third-party/HTML.Safe.php +++ b/pkg/vtiger/modules/MailManager/modules/MailManager/third-party/HTML.Safe.php @@ -272,7 +272,7 @@ class HTML_Safe foreach ($this->blackProtocols as $proto) { $preg = "/[\s\x01-\x1F]*"; for ($i=0; $i<strlen($proto); $i++) { - $preg .= $proto{$i} . "[\s\x01-\x1F]*"; + $preg .= $proto[$i] . "[\s\x01-\x1F]*"; } $preg .= ":/i"; $this->protoRegexps[] = $preg; diff --git a/pkg/vtiger/modules/MailManager/modules/MailManager/third-party/XML/HTMLSax3.php b/pkg/vtiger/modules/MailManager/modules/MailManager/third-party/XML/HTMLSax3.php index 5314404f3f1714e26d38ee6aca448895a467b3da..f6c42da17a4393a0f6167315c768f7b386c153a1 100644 --- a/pkg/vtiger/modules/MailManager/modules/MailManager/third-party/XML/HTMLSax3.php +++ b/pkg/vtiger/modules/MailManager/modules/MailManager/third-party/XML/HTMLSax3.php @@ -204,7 +204,7 @@ class XML_HTMLSax3_StateParser { */ function scanCharacter() { if ($this->position < $this->length) { - return $this->rawtext{$this->position++}; + return $this->rawtext[$this->position++]; } } @@ -357,7 +357,7 @@ class XML_HTMLSax3_StateParser_Lt430 extends XML_HTMLSax3_StateParser { */ function scanUntilCharacters($string) { $startpos = $this->position; - while ($this->position < $this->length && strpos($string, $this->rawtext{$this->position}) === FALSE) { + while ($this->position < $this->length && strpos($string, $this->rawtext[$this->position]) === FALSE) { $this->position++; } return substr($this->rawtext, $startpos, $this->position - $startpos); @@ -370,7 +370,7 @@ class XML_HTMLSax3_StateParser_Lt430 extends XML_HTMLSax3_StateParser { */ function ignoreWhitespace() { while ($this->position < $this->length && - strpos(" \n\r\t", $this->rawtext{$this->position}) !== FALSE) { + strpos(" \n\r\t", $this->rawtext[$this->position]) !== FALSE) { $this->position++; } } diff --git a/pkg/vtiger/modules/MailManager/modules/MailManager/third-party/XML/Util.php b/pkg/vtiger/modules/MailManager/modules/MailManager/third-party/XML/Util.php index 69caf24caf8f8ce08899b19ed56d977c64f0707a..66218873f10f6bed433a7fa0f937c0f17e0e8c84 100644 --- a/pkg/vtiger/modules/MailManager/modules/MailManager/third-party/XML/Util.php +++ b/pkg/vtiger/modules/MailManager/modules/MailManager/third-party/XML/Util.php @@ -882,7 +882,7 @@ class XML_Util public static function isValidName($string) { // check for invalid chars - if (!preg_match('/^[[:alpha:]_]\\z/', $string{0})) { + if (!preg_match('/^[[:alpha:]_]\\z/', $string[0])) { return XML_Util::raiseError( 'XML names may only start with letter or underscore', XML_UTIL_ERROR_INVALID_START diff --git a/pkg/vtiger/translations/ItalianLanguagePack_it_it/modules/PurchaseOrder.php b/pkg/vtiger/translations/ItalianLanguagePack_it_it/modules/PurchaseOrder.php index 6a13ef2c6e42c4c5374b1360981ec579e6eb081c..319e0b11a4999176241ca10d3e1b8db47356dd33 100644 --- a/pkg/vtiger/translations/ItalianLanguagePack_it_it/modules/PurchaseOrder.php +++ b/pkg/vtiger/translations/ItalianLanguagePack_it_it/modules/PurchaseOrder.php @@ -22,7 +22,7 @@ $languageStrings = array( 'Tracking Number' => 'Numero Tracking' , 'Sales Commission' => 'Commissioni Vendita' , 'LBL_PAID' => 'Pagato' , - 'LBL_BALANCE' => 'Saldo' , S + 'LBL_BALANCE' => 'Saldo' , 'Received Shipment' => 'Spedizione Ricevuta' , 'LBL_LIST_PRICE' => 'Prezzo di listino', 'List Price' => 'Prezzo di listino', diff --git a/vtlib/thirdparty/network/Net/URL.php b/vtlib/thirdparty/network/Net/URL.php index 3dcfef60d0c0ec4b113d340682bbce468e79a858..3c7876794ddb75bc5f834e1ef1acfa69af633a41 100644 --- a/vtlib/thirdparty/network/Net/URL.php +++ b/vtlib/thirdparty/network/Net/URL.php @@ -190,7 +190,7 @@ class Net_URL break; case 'path': - if ($value{0} == '/') { + if ($value[0] == '/') { $this->path = $value; } else { $path = dirname($this->path) == DIRECTORY_SEPARATOR ? '' : dirname($this->path); diff --git a/vtlib/thirdparty/network/Request.php b/vtlib/thirdparty/network/Request.php index d25a390ffcd7c7f98b85c70e387a6c31cba2c97a..8603101844ba0fc2f42bdda68b66f3bb1b871d64 100644 --- a/vtlib/thirdparty/network/Request.php +++ b/vtlib/thirdparty/network/Request.php @@ -798,7 +798,7 @@ class HTTP_Request $this->_url = new Net_URL($redirect); $this->addHeader('Host', $this->_generateHostHeader()); // Absolute path - } elseif ($redirect{0} == '/') { + } elseif ($redirect[0] == '/') { $this->_url->path = $redirect; // Relative path