diff --git a/build/phpcs/Joomla/Sniffs/Commenting/FileCommentSniff.php b/build/phpcs/Joomla/Sniffs/Commenting/FileCommentSniff.php index cb861a808f560..deb848329facd 100644 --- a/build/phpcs/Joomla/Sniffs/Commenting/FileCommentSniff.php +++ b/build/phpcs/Joomla/Sniffs/Commenting/FileCommentSniff.php @@ -593,9 +593,9 @@ protected function processPackage($errorPos) $newContent = str_replace(' ', '_', $content); $nameBits = explode('_', $newContent); $firstBit = array_shift($nameBits); - $newName = strtoupper($firstBit{0}).substr($firstBit, 1).'_'; + $newName = strtoupper($firstBit[0]).substr($firstBit, 1).'_'; foreach ($nameBits as $bit) { - $newName .= strtoupper($bit{0}).substr($bit, 1).'_'; + $newName .= strtoupper($bit[0]).substr($bit, 1).'_'; } $error = 'Package name "%s" is not valid; consider "%s" instead'; @@ -632,9 +632,9 @@ protected function processSubpackage($errorPos) // $newContent = str_replace(' ', '_', $content); // $nameBits = explode('_', $newContent); // $firstBit = array_shift($nameBits); -// $newName = strtoupper($firstBit{0}).substr($firstBit, 1).'_'; +// $newName = strtoupper($firstBit[0]).substr($firstBit, 1).'_'; // foreach ($nameBits as $bit) { -// $newName .= strtoupper($bit{0}).substr($bit, 1).'_'; +// $newName .= strtoupper($bit[0]).substr($bit, 1).'_'; // } // // $error = 'Subpackage name "%s" is not valid; consider "%s" instead'; diff --git a/build/phpcs/Joomla/Sniffs/Commenting/SingleCommentSniff.php b/build/phpcs/Joomla/Sniffs/Commenting/SingleCommentSniff.php index b64c9f5fd5c23..5f701b1dba37d 100644 --- a/build/phpcs/Joomla/Sniffs/Commenting/SingleCommentSniff.php +++ b/build/phpcs/Joomla/Sniffs/Commenting/SingleCommentSniff.php @@ -51,7 +51,7 @@ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) * The exception to this is if the preceding line consists of a single open bracket. */ - if (isset($comment{2}) && $comment{2} != ' ') + if (isset($comment[2]) && $comment[2] != ' ') { $phpcsFile->addError('Please put a space between the // and the start of comment text; found "%s"' , $stackPtr, 'NoSpace', array($comment)); @@ -65,7 +65,7 @@ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) * The term is code and is case sensitive.(@todo) */ - if (isset($comment{3}) && $comment{3} != strtoupper($comment{3})) + if (isset($comment[3]) && $comment[3] != strtoupper($comment[3])) { // Comment does not start with an upper case letter diff --git a/installation/model/database.php b/installation/model/database.php index 6d983dd80649e..c543138fc74df 100644 --- a/installation/model/database.php +++ b/installation/model/database.php @@ -1199,7 +1199,7 @@ public function populateDatabase($db, $schema) $query = trim($query); // If the query isn't empty and is not a MySQL or PostgreSQL comment, execute it. - if (!empty($query) && ($query{0} != '#') && ($query{0} != '-')) + if (!empty($query) && ($query[0] != '#') && ($query[0] != '-')) { /** * If we don't have UTF-8 Multibyte support we'll have to convert queries to plain UTF-8 diff --git a/libraries/fof/database/driver.php b/libraries/fof/database/driver.php index 27b17efc2eeb1..9e0dd68fbadc9 100644 --- a/libraries/fof/database/driver.php +++ b/libraries/fof/database/driver.php @@ -4,6 +4,7 @@ * @subpackage database * @copyright Copyright (C) 2010-2016 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt + * @note This file has been modified by the Joomla! Project and no longer reflects the original work of its author. * * This file is adapted from the Joomla! Platform. It is used to iterate a database cursor returning FOFTable objects * instead of plain stdClass objects @@ -1898,7 +1899,7 @@ protected function quoteNameStr($strArr) } else { - $parts[] = $q{0} . $part . $q{1}; + $parts[] = $q[0] . $part . $q[1]; } } @@ -1974,7 +1975,7 @@ public function replacePrefix($sql, $prefix = '#__') $l = $k - 1; - while ($l >= 0 && $sql{$l} == '\\') + while ($l >= 0 && $sql[$l] == '\\') { $l--; $escaped = !$escaped; diff --git a/libraries/fof/database/driver/joomla.php b/libraries/fof/database/driver/joomla.php index 63b67627fec77..cfffe64f84637 100644 --- a/libraries/fof/database/driver/joomla.php +++ b/libraries/fof/database/driver/joomla.php @@ -4,6 +4,7 @@ * @subpackage database * @copyright Copyright (C) 2010-2016 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt + * @note This file has been modified by the Joomla! Project and no longer reflects the original work of its author. * * This file is adapted from the Joomla! Platform. It is used to iterate a database cursor returning FOFTable objects * instead of plain stdClass objects @@ -596,7 +597,7 @@ protected function quoteNameStr($strArr) } else { - $parts[] = $q{0} . $part . $q{1}; + $parts[] = $q[0] . $part . $q[1]; } } diff --git a/libraries/fof/database/driver/oracle.php b/libraries/fof/database/driver/oracle.php index 155246e5de1fb..b760522c56eca 100644 --- a/libraries/fof/database/driver/oracle.php +++ b/libraries/fof/database/driver/oracle.php @@ -4,6 +4,7 @@ * @subpackage database * @copyright Copyright (C) 2010-2016 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt + * @note This file has been modified by the Joomla! Project and no longer reflects the original work of its author. * * This file is adapted from the Joomla! Platform. It is used to iterate a database cursor returning FOFTable objects * instead of plain stdClass objects @@ -595,7 +596,7 @@ public function replacePrefix($query, $prefix = '#__') $l = $k - 1; - while ($l >= 0 && $query{$l} == '\\') + while ($l >= 0 && $query[$l] == '\\') { $l--; $escaped = !$escaped; diff --git a/libraries/fof/database/driver/sqlsrv.php b/libraries/fof/database/driver/sqlsrv.php index cf47e2b873d7a..e637c24078637 100644 --- a/libraries/fof/database/driver/sqlsrv.php +++ b/libraries/fof/database/driver/sqlsrv.php @@ -4,6 +4,7 @@ * @subpackage database * @copyright Copyright (C) 2010-2016 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt + * @note This file has been modified by the Joomla! Project and no longer reflects the original work of its author. * * This file is adapted from the Joomla! Platform. It is used to iterate a database cursor returning FOFTable objects * instead of plain stdClass objects @@ -783,7 +784,7 @@ public function replacePrefix($query, $prefix = '#__') $l = $k - 1; - while ($l >= 0 && $query{$l} == '\\') + while ($l >= 0 && $query[$l] == '\\') { $l--; $escaped = !$escaped; diff --git a/libraries/fof/less/less.php b/libraries/fof/less/less.php index d4e14fbd74eb3..e0c905b4ad35b 100644 --- a/libraries/fof/less/less.php +++ b/libraries/fof/less/less.php @@ -4,6 +4,7 @@ * @subpackage less * @copyright Copyright (C) 2010-2016 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt + * @note This file has been modified by the Joomla! Project and no longer reflects the original work of its author. */ // Protect from unauthorized access defined('FOF_INCLUDED') or die; @@ -1064,7 +1065,7 @@ protected function compileProp($prop, $block, $out) if ($suffix !== null && $subProp[0] == "assign" && is_string($subProp[1]) - && $subProp[1]{0} != $this->vPrefix) + && $subProp[1][0] != $this->vPrefix) { $subProp[2] = array( 'list', ' ', @@ -2819,7 +2820,7 @@ protected function injectVariables($args) /** FOF -- END CHANGE * */ foreach ($args as $name => $strValue) { - if ($name{0} != '@') + if ($name[0] != '@') { $name = '@' . $name; } diff --git a/libraries/fof/less/parser/parser.php b/libraries/fof/less/parser/parser.php index fa4021a9f3c25..0cd976008520a 100644 --- a/libraries/fof/less/parser/parser.php +++ b/libraries/fof/less/parser/parser.php @@ -4,6 +4,7 @@ * @subpackage less * @copyright Copyright (C) 2010-2016 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt + * @note This file has been modified by the Joomla! Project and no longer reflects the original work of its author. */ // Protect from unauthorized access defined('FOF_INCLUDED') or die; @@ -345,7 +346,7 @@ protected function parseChunk() { foreach ($block->tags as $tag) { - if (!is_string($tag) || $tag{0} != $this->lessc->mPrefix) + if (!is_string($tag) || $tag[0] != $this->lessc->mPrefix) { $hidden = false; break; @@ -428,7 +429,7 @@ protected function fixTags($tags) // Move @ tags out of variable namespace foreach ($tags as &$tag) { - if ($tag{0} == $this->lessc->vPrefix) + if ($tag[0] == $this->lessc->vPrefix) { $tag[0] = $this->lessc->mPrefix; } @@ -1676,7 +1677,7 @@ protected function end() { return true; } - elseif ($this->count == strlen($this->buffer) || $this->buffer{$this->count} == '}') + elseif ($this->count == strlen($this->buffer) || $this->buffer[$this->count] == '}') { // If there is end of file or a closing block next then we don't need a ; return true; diff --git a/libraries/fof/utils/ini/parser.php b/libraries/fof/utils/ini/parser.php index 2c8efdf1f83ae..a4e74ff7189f8 100644 --- a/libraries/fof/utils/ini/parser.php +++ b/libraries/fof/utils/ini/parser.php @@ -4,6 +4,7 @@ * @subpackage utils * @copyright Copyright (C) 2010-2016 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt + * @note This file has been modified by the Joomla! Project and no longer reflects the original work of its author. */ defined('FOF_INCLUDED') or die; @@ -102,7 +103,7 @@ static function parse_ini_file_php($file, $process_sections = false, $rawdata = } // Sections - if ($line{0} == '[') + if ($line[0] == '[') { $tmp = explode(']', $line); $sections[] = trim(substr($tmp[0], 1)); @@ -125,7 +126,7 @@ static function parse_ini_file_php($file, $process_sections = false, $rawdata = $tmp = explode(';', $value); if (count($tmp) == 2) { - if ((($value{0} != '"') && ($value{0} != "'")) || + if ((($value[0] != '"') && ($value[0] != "'")) || preg_match('/^".*"\s*;/', $value) || preg_match('/^".*;[^"]*$/', $value) || preg_match("/^'.*'\s*;/", $value) || preg_match("/^'.*;[^']*$/", $value) ) @@ -135,11 +136,11 @@ static function parse_ini_file_php($file, $process_sections = false, $rawdata = } else { - if ($value{0} == '"') + if ($value[0] == '"') { $value = preg_replace('/^"(.*)".*/', '$1', $value); } - elseif ($value{0} == "'") + elseif ($value[0] == "'") { $value = preg_replace("/^'(.*)'.*/", '$1', $value); } diff --git a/libraries/idna_convert/idna_convert.class.php b/libraries/idna_convert/idna_convert.class.php index 949bd4a6a1472..0e51e37572873 100644 --- a/libraries/idna_convert/idna_convert.class.php +++ b/libraries/idna_convert/idna_convert.class.php @@ -49,6 +49,7 @@ * @author Matthias Sommerfeld * @copyright 2004-2011 phlyLabs Berlin, http://phlylabs.de * @version 0.8.0 2011-03-11 + * @note This file has been modified by the Joomla! Project and no longer reflects the original work of its author. */ class idna_convert { @@ -418,7 +419,7 @@ protected function _decode($encoded) $delim_pos = strrpos($encoded, '-'); if ($delim_pos > self::byteLength($this->_punycode_prefix)) { for ($k = self::byteLength($this->_punycode_prefix); $k < $delim_pos; ++$k) { - $decoded[] = ord($encoded{$k}); + $decoded[] = ord($encoded[$k]); } } $deco_len = count($decoded); @@ -432,7 +433,7 @@ protected function _decode($encoded) for ($enco_idx = ($delim_pos) ? ($delim_pos + 1) : 0; $enco_idx < $enco_len; ++$deco_len) { for ($old_idx = $idx, $w = 1, $k = $this->_base; 1 ; $k += $this->_base) { - $digit = $this->_decode_digit($encoded{$enco_idx++}); + $digit = $this->_decode_digit($encoded[$enco_idx++]); $idx += $digit * $w; $t = ($k <= $bias) ? $this->_tmin : (($k >= $bias + $this->_tmax) ? $this->_tmax : ($k - $bias)); @@ -823,7 +824,7 @@ protected function _utf8_to_ucs4($input) $mode = 'next'; $test = 'none'; for ($k = 0; $k < $inp_len; ++$k) { - $v = ord($input{$k}); // Extract byte from input string + $v = ord($input[$k]); // Extract byte from input string if ($v < 128) { // We found an ASCII char - put into stirng as is $output[$out_len] = $v; ++$out_len; @@ -954,7 +955,7 @@ protected function _ucs4_string_to_ucs4($input) $out_len++; $output[$out_len] = 0; } - $output[$out_len] += ord($input{$i}) << (8 * (3 - ($i % 4) ) ); + $output[$out_len] += ord($input[$i]) << (8 * (3 - ($i % 4) ) ); } return $output; } diff --git a/libraries/idna_convert/transcode_wrapper.php b/libraries/idna_convert/transcode_wrapper.php index 6862e40cce452..82cef4d0510c2 100644 --- a/libraries/idna_convert/transcode_wrapper.php +++ b/libraries/idna_convert/transcode_wrapper.php @@ -15,6 +15,7 @@ *[@param bool Safe Mode: if set to TRUE, the original string is retunred on errors] * @return string The encoded string or false on failure * @since 0.0.1 + * @note This file has been modified by the Joomla! Project and no longer reflects the original work of its author. */ function encode_utf8($string = '', $encoding = 'iso-8859-1', $safe_mode = false) { @@ -92,7 +93,7 @@ function map_w1252_iso8859_1($string = '') if ($string == '') return ''; $return = ''; for ($i = 0; $i < strlen($string); ++$i) { - $c = ord($string{$i}); + $c = ord($string[$i]); switch ($c) { case 129: $return .= chr(252); break; case 132: $return .= chr(228); break; @@ -119,7 +120,7 @@ function map_iso8859_1_w1252($string = '') if ($string == '') return ''; $return = ''; for ($i = 0; $i < strlen($string); ++$i) { - $c = ord($string{$i}); + $c = ord($string[$i]); switch ($c) { case 196: $return .= chr(142); break; case 214: $return .= chr(153); break; diff --git a/libraries/idna_convert/uctc.php b/libraries/idna_convert/uctc.php index ea5e4769ce9be..7673a08aac0ef 100644 --- a/libraries/idna_convert/uctc.php +++ b/libraries/idna_convert/uctc.php @@ -14,6 +14,7 @@ * @author Matthias Sommerfeld * @copyright 2003-2009 phlyLabs Berlin, http://phlylabs.de * @version 0.0.6 2009-05-10 + * @note This file has been modified by the Joomla! Project and no longer reflects the original work of its author. */ class uctc { private static $mechs = array('ucs4', /*'ucs4le', 'ucs4be', */'ucs4array', /*'utf16', 'utf16le', 'utf16be', */'utf8', 'utf7', 'utf7imap'); @@ -59,7 +60,7 @@ private static function utf8_ucs4array($input) $mode = 'next'; $test = 'none'; for ($k = 0; $k < $inp_len; ++$k) { - $v = ord($input{$k}); // Extract byte from input string + $v = ord($input[$k]); // Extract byte from input string if ($v < 128) { // We found an ASCII char - put into stirng as is $output[$out_len] = $v; @@ -176,7 +177,7 @@ private static function utf7_ucs4array($input, $sc = '+') $b64 = ''; for ($k = 0; $k < $inp_len; ++$k) { - $c = $input{$k}; + $c = $input[$k]; if (0 == ord($c)) continue; // Ignore zero bytes if ('b' == $mode) { // Sequence got terminated @@ -193,10 +194,10 @@ private static function utf7_ucs4array($input, $sc = '+') $tmp = substr($tmp, -1 * (strlen($tmp) % 2)); for ($i = 0; $i < strlen($tmp); $i++) { if ($i % 2) { - $output[$out_len] += ord($tmp{$i}); + $output[$out_len] += ord($tmp[$i]); $out_len++; } else { - $output[$out_len] = ord($tmp{$i}) << 8; + $output[$out_len] = ord($tmp[$i]) << 8; } } $mode = 'd'; @@ -292,7 +293,7 @@ private static function ucs4_ucs4array($input) $out_len++; $output[$out_len] = 0; } - $output[$out_len] += ord($input{$i}) << (8 * (3 - ($i % 4) ) ); + $output[$out_len] += ord($input[$i]) << (8 * (3 - ($i % 4) ) ); } return $output; } diff --git a/libraries/joomla/database/driver.php b/libraries/joomla/database/driver.php index fddde604099dd..7a98a191c4827 100644 --- a/libraries/joomla/database/driver.php +++ b/libraries/joomla/database/driver.php @@ -1968,7 +1968,7 @@ protected function quoteNameStr($strArr) } else { - $parts[] = $q{0} . str_replace($q{1}, $q{1} . $q{1}, $part) . $q{1}; + $parts[] = $q[0] . str_replace($q[1], $q[1] . $q[1], $part) . $q[1]; } } @@ -2044,7 +2044,7 @@ public function replacePrefix($sql, $prefix = '#__') $l = $k - 1; - while ($l >= 0 && $sql{$l} == '\\') + while ($l >= 0 && $sql[$l] == '\\') { $l--; $escaped = !$escaped; diff --git a/libraries/joomla/database/driver/oracle.php b/libraries/joomla/database/driver/oracle.php index 88646077cceb9..f8ff3133b733a 100644 --- a/libraries/joomla/database/driver/oracle.php +++ b/libraries/joomla/database/driver/oracle.php @@ -582,7 +582,7 @@ public function replacePrefix($query, $prefix = '#__') $l = $k - 1; - while ($l >= 0 && $query{$l} == '\\') + while ($l >= 0 && $query[$l] == '\\') { $l--; $escaped = !$escaped; diff --git a/libraries/src/Client/FtpClient.php b/libraries/src/Client/FtpClient.php index 7d3717f7d61dd..744c16f41c473 100644 --- a/libraries/src/Client/FtpClient.php +++ b/libraries/src/Client/FtpClient.php @@ -1644,7 +1644,7 @@ public function listDetails($path = null, $type = 'all') if (@preg_match($regexp, $file, $regs)) { - $fType = (int) strpos('-dl', $regs[1]{0}); + $fType = (int) strpos('-dl', $regs[1][0]); // $tmp_array['line'] = $regs[0]; $tmp_array['type'] = $fType; diff --git a/libraries/src/Filesystem/Path.php b/libraries/src/Filesystem/Path.php index 14ec74ec6e055..afbbd6734b808 100644 --- a/libraries/src/Filesystem/Path.php +++ b/libraries/src/Filesystem/Path.php @@ -145,13 +145,13 @@ public static function getPermissions($path) for ($i = 0; $i < 3; $i++) { // Read - $parsed_mode .= ($mode{$i} & 04) ? 'r' : '-'; + $parsed_mode .= ($mode[$i] & 04) ? 'r' : '-'; // Write - $parsed_mode .= ($mode{$i} & 02) ? 'w' : '-'; + $parsed_mode .= ($mode[$i] & 02) ? 'w' : '-'; // Execute - $parsed_mode .= ($mode{$i} & 01) ? 'x' : '-'; + $parsed_mode .= ($mode[$i] & 01) ? 'x' : '-'; } return $parsed_mode; diff --git a/libraries/src/Language/Stemmer/Porteren.php b/libraries/src/Language/Stemmer/Porteren.php index 837bd0aef755a..b71f87aeb4be7 100644 --- a/libraries/src/Language/Stemmer/Porteren.php +++ b/libraries/src/Language/Stemmer/Porteren.php @@ -425,7 +425,7 @@ private static function _doubleConsonant($str) { $c = self::$_regex_consonant; - return preg_match("#$c{2}$#", $str, $matches) && $matches[0]{0} == $matches[0]{1}; + return preg_match("#$c{2}$#", $str, $matches) && $matches[0][0] == $matches[0][1]; } /** @@ -444,9 +444,9 @@ private static function _cvc($str) $result = preg_match("#($c$v$c)$#", $str, $matches) && strlen($matches[1]) == 3 - && $matches[1]{2} != 'w' - && $matches[1]{2} != 'x' - && $matches[1]{2} != 'y'; + && $matches[1][2] != 'w' + && $matches[1][2] != 'x' + && $matches[1][2] != 'y'; return $result; } diff --git a/libraries/src/User/UserHelper.php b/libraries/src/User/UserHelper.php index b60f1612f00e1..dcfb83dc1db68 100644 --- a/libraries/src/User/UserHelper.php +++ b/libraries/src/User/UserHelper.php @@ -633,7 +633,7 @@ public static function getSalt($encryption = 'md5-hex', $seed = '', $plaintext = for ($i = 0; $i < 8; $i++) { - $salt .= $APRMD5{mt_rand(0, 63)}; + $salt .= $APRMD5[mt_rand(0, 63)]; } return $salt; diff --git a/plugins/editors/codemirror/layouts/editors/codemirror/styles.php b/plugins/editors/codemirror/layouts/editors/codemirror/styles.php index ed7f19009fe55..b12870c336e86 100644 --- a/plugins/editors/codemirror/layouts/editors/codemirror/styles.php +++ b/plugins/editors/codemirror/layouts/editors/codemirror/styles.php @@ -17,16 +17,16 @@ // Set the active line color. $color = $params->get('activeLineColor', '#a4c2eb'); -$r = hexdec($color{1} . $color{2}); -$g = hexdec($color{3} . $color{4}); -$b = hexdec($color{5} . $color{6}); +$r = hexdec($color[1] . $color[2]); +$g = hexdec($color[3] . $color[4]); +$b = hexdec($color[5] . $color[6]); $activeLineColor = 'rgba(' . $r . ', ' . $g . ', ' . $b . ', .5)'; // Set the color for matched tags. $color = $params->get('highlightMatchColor', '#fa542f'); -$r = hexdec($color{1} . $color{2}); -$g = hexdec($color{3} . $color{4}); -$b = hexdec($color{5} . $color{6}); +$r = hexdec($color[1] . $color[2]); +$g = hexdec($color[3] . $color[4]); +$b = hexdec($color[5] . $color[6]); $highlightMatchColor = 'rgba(' . $r . ', ' . $g . ', ' . $b . ', .5)'; JFactory::getDocument()->addStyleDeclaration(