diff --git a/.travis.yml b/.travis.yml index 47e0c3e2fa..0d9052bf4e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,10 +1,7 @@ language: php php: + - 7.4 - 7.3 - - 7.2 - - 7.1 - - 7.0 - - 5.6 before_script: - composer install --dev diff --git a/lib/cache/sfFileCache.class.php b/lib/cache/sfFileCache.class.php index b02957955a..a01c15e79d 100644 --- a/lib/cache/sfFileCache.class.php +++ b/lib/cache/sfFileCache.class.php @@ -215,8 +215,7 @@ protected function read($path, $type = self::READ_DATA) @flock($fp, LOCK_SH); clearstatcache(); // because the filesize can be cached by PHP itself... $length = @filesize($path); - $mqr = get_magic_quotes_runtime(); - set_magic_quotes_runtime(0); + switch ($type) { case self::READ_TIMEOUT: @@ -240,7 +239,6 @@ protected function read($path, $type = self::READ_DATA) default: throw new sfConfigurationException(sprintf('Unknown type "%s".', $type)); } - set_magic_quotes_runtime($mqr); @flock($fp, LOCK_UN); @fclose($fp); diff --git a/lib/helper/UrlHelper.php b/lib/helper/UrlHelper.php index 7fe60822d9..c0d40c351f 100644 --- a/lib/helper/UrlHelper.php +++ b/lib/helper/UrlHelper.php @@ -471,7 +471,7 @@ function _encodeText($text) for ($i = 0; $i < strlen($text); $i++) { - $char = $text{$i}; + $char = $text[$i]; $r = rand(0, 100); # roughly 10% raw, 45% hex, 45% dec diff --git a/lib/i18n/sfDateFormat.class.php b/lib/i18n/sfDateFormat.class.php index 4cf145cb08..e0ddc5c638 100644 --- a/lib/i18n/sfDateFormat.class.php +++ b/lib/i18n/sfDateFormat.class.php @@ -221,7 +221,7 @@ public function format($time, $pattern = 'F', $inputPattern = null, $charset = ' for ($i = 0, $max = count($tokens); $i < $max; $i++) { $pattern = $tokens[$i]; - if ($pattern{0} == "'" && $pattern{strlen($pattern) - 1} == "'") + if ($pattern[0] == "'" && $pattern[strlen($pattern) - 1] == "'") { $tokens[$i] = str_replace('``````', '\'', preg_replace('/(^\')|(\'$)/', '', $pattern)); } @@ -258,9 +258,9 @@ public function format($time, $pattern = 'F', $inputPattern = null, $charset = ' */ protected function getFunctionName($token) { - if (isset($this->tokens[$token{0}])) + if (isset($this->tokens[$token[0]])) { - return $this->tokens[$token{0}]; + return $this->tokens[$token[0]]; } } @@ -389,30 +389,30 @@ protected function getTokens($pattern) for ($i = 0, $max = strlen($pattern); $i < $max; $i++) { - if ($char == null || $pattern{$i} == $char || $text) + if ($char == null || $pattern[$i] == $char || $text) { - $token .= $pattern{$i}; + $token .= $pattern[$i]; } else { $tokens[] = str_replace("''", "'", $token); - $token = $pattern{$i}; + $token = $pattern[$i]; } - if ($pattern{$i} == "'" && $text == false) + if ($pattern[$i] == "'" && $text == false) { $text = true; } - else if ($text && $pattern{$i} == "'" && $char == "'") + else if ($text && $pattern[$i] == "'" && $char == "'") { $text = true; } - else if ($text && $char != "'" && $pattern{$i} == "'") + else if ($text && $char != "'" && $pattern[$i] == "'") { $text = false; } - $char = $pattern{$i}; + $char = $pattern[$i]; } $tokens[] = $token; diff --git a/lib/i18n/sfNumberFormat.class.php b/lib/i18n/sfNumberFormat.class.php index f23b6d27ef..10df7aaf06 100644 --- a/lib/i18n/sfNumberFormat.class.php +++ b/lib/i18n/sfNumberFormat.class.php @@ -204,7 +204,7 @@ protected function formatInteger($string) // now for the integer groupings for ($i = 0; $i < $len; $i++) { - $char = $string{$len - $i - 1}; + $char = $string[$len - $i - 1]; if ($multiGroup && $count == 0) { diff --git a/lib/i18n/sfNumberFormatInfo.class.php b/lib/i18n/sfNumberFormatInfo.class.php index 54de9b0745..b85c8b54d8 100644 --- a/lib/i18n/sfNumberFormatInfo.class.php +++ b/lib/i18n/sfNumberFormatInfo.class.php @@ -311,7 +311,7 @@ protected function parsePattern($pattern) // to find the groupsize 1. for ($i = strlen($pattern) - 1; $i >= 0; $i--) { - if ($pattern{$i} == $digit || $pattern{$i} == $hash) + if ($pattern[$i] == $digit || $pattern[$i] == $hash) { $groupSize1 = $i - $groupPos1; break; @@ -330,11 +330,11 @@ protected function parsePattern($pattern) { for ($i = strlen($pattern) - 1; $i >= 0; $i--) { - if ($pattern{$i} == $dot) + if ($pattern[$i] == $dot) { break; } - if ($pattern{$i} == $digit) + if ($pattern[$i] == $digit) { $decimalPoints = $i - $decimalPos; break; diff --git a/lib/plugins/sfPropelPlugin/lib/vendor/creole/drivers/pgsql/PgSQLResultSet.php b/lib/plugins/sfPropelPlugin/lib/vendor/creole/drivers/pgsql/PgSQLResultSet.php index 77c400f4f9..3ef66968ec 100644 --- a/lib/plugins/sfPropelPlugin/lib/vendor/creole/drivers/pgsql/PgSQLResultSet.php +++ b/lib/plugins/sfPropelPlugin/lib/vendor/creole/drivers/pgsql/PgSQLResultSet.php @@ -137,7 +137,7 @@ private function strToArray($str) $res[] = $this->strToArray(implode(',', $subarr[$in_subarr])); $in_subarr--; } - } elseif ($tok{0} === '{') { // we're inside a new sub-array + } elseif ($tok[0] === '{') { // we're inside a new sub-array if ('}' !== substr($tok, -1, 1)) { $in_subarr++; // if sub-array has more than one element diff --git a/lib/plugins/sfPropelPlugin/lib/vendor/creole/util/sql/SQLStatementExtractor.php b/lib/plugins/sfPropelPlugin/lib/vendor/creole/util/sql/SQLStatementExtractor.php index f4c79a4e83..ca14b51ee4 100644 --- a/lib/plugins/sfPropelPlugin/lib/vendor/creole/util/sql/SQLStatementExtractor.php +++ b/lib/plugins/sfPropelPlugin/lib/vendor/creole/util/sql/SQLStatementExtractor.php @@ -143,7 +143,7 @@ protected static function substring($string, $startpos, $endpos = -1) { trigger_error("substring(), Endindex out of bounds must be $startpos /home/user/foo + if ($strPathname[0] === "~") { + if ($strPathname[1] === "/") { // like ~/foo => /home/user/foo $strPathname = "/home/" . get_current_user() . substr($strPathname, 1); } else { // like ~foo => /home/foo $pos = strpos($strPathname, "/"); @@ -88,7 +88,7 @@ function normalize($strPathname) { $n = strlen($strPathname); $prevChar = 0; for ($i=0; $i < $n; $i++) { - $c = $strPathname{$i}; + $c = $strPathname[$i]; if (($prevChar === '/') && ($c === '/')) { return self::normalizer($strPathname, $n, $i - 1); } @@ -109,7 +109,7 @@ protected function normalizer($pathname, $len, $offset) { return $pathname; } $n = (int) $len; - while (($n > 0) && ($pathname{$n-1} === '/')) { + while (($n > 0) && ($pathname[$n-1] === '/')) { $n--; } if ($n === 0) { @@ -122,7 +122,7 @@ protected function normalizer($pathname, $len, $offset) { } $prevChar = 0; for ($i = $offset; $i < $n; $i++) { - $c = $pathname{$i}; + $c = $pathname[$i]; if (($prevChar === '/') && ($c === '/')) { continue; } @@ -140,7 +140,7 @@ function prefixLength($pathname) { if (strlen($pathname === 0)) { return 0; } - return (($pathname{0} === '/') ? 1 : 0); + return (($pathname[0] === '/') ? 1 : 0); } /** @@ -154,7 +154,7 @@ function resolve($parent, $child) { return $parent; } - if ($child{0} === '/') { + if ($child[0] === '/') { if ($parent === '/') { return $child; } @@ -194,7 +194,7 @@ function resolveFile(PhingFile $f) { function getBooleanAttributes(&$f) { //$rv = getBooleanAttributes0($f); $name = $f->getName(); - $hidden = (strlen($name) > 0) && ($name{0} == '.'); + $hidden = (strlen($name) > 0) && ($name[0] == '.'); return ($hidden ? $this->BA_HIDDEN : 0); } diff --git a/lib/plugins/sfPropelPlugin/lib/vendor/phing/system/io/Win32FileSystem.php b/lib/plugins/sfPropelPlugin/lib/vendor/phing/system/io/Win32FileSystem.php index 3af4b9ed5c..1f51ef8912 100644 --- a/lib/plugins/sfPropelPlugin/lib/vendor/phing/system/io/Win32FileSystem.php +++ b/lib/plugins/sfPropelPlugin/lib/vendor/phing/system/io/Win32FileSystem.php @@ -48,7 +48,7 @@ function isLetter($c) { } function slashify($p) { - if ((strlen($p) > 0) && ($p{0} != $this->slash)) { + if ((strlen($p) > 0) && ($p[0] != $this->slash)) { return $this->slash.$p; } else { @@ -81,13 +81,13 @@ function getPathSeparator() { */ function normalizePrefix($strPath, $len, $sb) { $src = 0; - while (($src < $len) && $this->isSlash($strPath{$src})) { + while (($src < $len) && $this->isSlash($strPath[$src])) { $src++; } $c = ""; if (($len - $src >= 2) - && $this->isLetter($c = $strPath{$src}) - && $strPath{$src + 1} === ':') { + && $this->isLetter($c = $strPath[$src]) + && $strPath[$src + 1] === ':') { /* Remove leading slashes if followed by drive specifier. * This hack is necessary to support file URLs containing drive * specifiers (e.g., "file://c:/path"). As a side effect, @@ -99,8 +99,8 @@ function normalizePrefix($strPath, $len, $sb) { else { $src = 0; if (($len >= 2) - && $this->isSlash($strPath{0}) - && $this->isSlash($strPath{1})) { + && $this->isSlash($strPath[0]) + && $this->isSlash($strPath[1])) { /* UNC pathname: Retain first slash; leave src pointed at * second slash so that further slashes will be collapsed * into the second slash. The result will be a pathname @@ -138,15 +138,15 @@ protected function normalizer($strPath, $len, $offset) { // Remove redundant slashes from the remainder of the path, forcing all // slashes into the preferred slash while ($src < $len) { - $c = $strPath{$src++}; + $c = $strPath[$src++]; if ($this->isSlash($c)) { - while (($src < $len) && $this->isSlash($strPath{$src})) { + while (($src < $len) && $this->isSlash($strPath[$src])) { $src++; } if ($src === $len) { /* Check for trailing separator */ $sn = (int) strlen($sb); - if (($sn == 2) && ($sb{1} === ':')) { + if (($sn == 2) && ($sb[1] === ':')) { // "z:\\" $sb .= $slash; break; @@ -156,7 +156,7 @@ protected function normalizer($strPath, $len, $offset) { $sb .= $slash; break; } - if (($sn === 1) && ($this->isSlash($sb{0}))) { + if (($sn === 1) && ($this->isSlash($sb[0]))) { /* "\\\\" is not collapsed to "\\" because "\\\\" marks the beginning of a UNC pathname. Even though it is not, by itself, a valid UNC pathname, we leave it as @@ -194,7 +194,7 @@ function normalize($strPath) { $altSlash = $this->altSlash; $prev = 0; for ($i = 0; $i < $n; $i++) { - $c = $strPath{$i}; + $c = $strPath[$i]; if ($c === $altSlash) { return $this->normalizer($strPath, $n, ($prev === $slash) ? $i - 1 : $i); } @@ -219,8 +219,8 @@ function prefixLength($strPath) { if ($n === 0) { return 0; } - $c0 = $path{0}; - $c1 = ($n > 1) ? $path{1} : + $c0 = $path[0]; + $c1 = ($n > 1) ? $path[1] : 0; if ($c0 === $slash) { if ($c1 === $slash) { @@ -230,7 +230,7 @@ function prefixLength($strPath) { } if ($this->isLetter($c0) && ($c1 === ':')) { - if (($n > 2) && ($path{2}) === $slash) { + if (($n > 2) && ($path[2]) === $slash) { return 3; // Absolute local pathname "z:\\foo" */ } return 2; // Directory-relative "z:foo" @@ -253,8 +253,8 @@ function resolve($parent, $child) { } $c = $child; - if (($cn > 1) && ($c{0} === $slash)) { - if ($c{1} === $slash) { + if (($cn > 1) && ($c[0] === $slash)) { + if ($c[1] === $slash) { // drop prefix when child is a UNC pathname $c = substr($c, 2); } @@ -265,7 +265,7 @@ function resolve($parent, $child) { } $p = $parent; - if ($p{$pn - 1} === $slash) { + if ($p[$pn - 1] === $slash) { $p = substr($p, 0, $pn - 1); } return $p.$this->slashify($c); @@ -277,7 +277,7 @@ function getDefaultParent() { function fromURIPath($strPath) { $p = (string) $strPath; - if ((strlen($p) > 2) && ($p{2} === ':')) { + if ((strlen($p) > 2) && ($p[2] === ':')) { // "/c:/foo" --> "c:/foo" $p = substr($p,1); @@ -299,12 +299,12 @@ function fromURIPath($strPath) { function isAbsolute(PhingFile $f) { $pl = (int) $f->getPrefixLength(); $p = (string) $f->getPath(); - return ((($pl === 2) && ($p{0} === $this->slash)) || ($pl === 3) || ($pl === 1 && $p{0} === $this->slash)); + return ((($pl === 2) && ($p[0] === $this->slash)) || ($pl === 3) || ($pl === 1 && $p[0] === $this->slash)); } /** private */ function _driveIndex($d) { - $d = (string) $d{0}; + $d = (string) $d[0]; if ((ord($d) >= ord('a')) && (ord($d) <= ord('z'))) { return ord($d) - ord('a'); } @@ -316,7 +316,7 @@ function _driveIndex($d) { /** private */ function _getDriveDirectory($drive) { - $drive = (string) $drive{0}; + $drive = (string) $drive[0]; $i = (int) $this->_driveIndex($drive); if ($i < 0) { return null; @@ -348,7 +348,7 @@ function resolveFile(PhingFile $f) { $path = $f->getPath(); $pl = (int) $f->getPrefixLength(); - if (($pl === 2) && ($path{0} === $this->slash)) { + if (($pl === 2) && ($path[0] === $this->slash)) { return path; // UNC } @@ -375,7 +375,7 @@ function resolveFile(PhingFile $f) { if (($ud !== null) && StringHelper::startsWith($ud, $path)) { return (string) ($up . $this->slashify(substr($path,2))); } - $drive = (string) $path{0}; + $drive = (string) $path[0]; $dir = (string) $this->_getDriveDirectory($drive); $np = (string) ""; diff --git a/lib/plugins/sfPropelPlugin/lib/vendor/phing/system/util/Properties.php b/lib/plugins/sfPropelPlugin/lib/vendor/phing/system/util/Properties.php index 1bbaf86484..4527a66c91 100644 --- a/lib/plugins/sfPropelPlugin/lib/vendor/phing/system/util/Properties.php +++ b/lib/plugins/sfPropelPlugin/lib/vendor/phing/system/util/Properties.php @@ -81,7 +81,7 @@ protected function parse($filePath) { if($line == "") continue; - if ($line{0} == '#' or $line{0} == ';') { + if ($line[0] == '#' or $line[0] == ';') { // it's a comment, so continue to next line continue; } else { diff --git a/lib/plugins/sfPropelPlugin/lib/vendor/phing/tasks/system/CvsPassTask.php b/lib/plugins/sfPropelPlugin/lib/vendor/phing/tasks/system/CvsPassTask.php index 16d03393cf..f85dc5693d 100644 --- a/lib/plugins/sfPropelPlugin/lib/vendor/phing/tasks/system/CvsPassTask.php +++ b/lib/plugins/sfPropelPlugin/lib/vendor/phing/tasks/system/CvsPassTask.php @@ -141,7 +141,7 @@ public final function main() { private final function mangle($password){ $buf = ""; for ($i = 0, $plen = strlen($password); $i < $plen; $i++) { - $buf .= chr(self::$shifts[ord($password{$i})]); + $buf .= chr(self::$shifts[ord($password[$i])]); } return $buf; } diff --git a/lib/plugins/sfPropelPlugin/lib/vendor/phing/tasks/system/PropertyTask.php b/lib/plugins/sfPropelPlugin/lib/vendor/phing/tasks/system/PropertyTask.php index 522907a13d..f44603a5ce 100644 --- a/lib/plugins/sfPropelPlugin/lib/vendor/phing/tasks/system/PropertyTask.php +++ b/lib/plugins/sfPropelPlugin/lib/vendor/phing/tasks/system/PropertyTask.php @@ -412,7 +412,7 @@ protected function parsePropertyString($value, &$fragments, &$propertyRefs) { if ($pos === (strlen($value) - 1)) { array_push($fragments, '$'); $prev = $pos + 1; - } elseif ($value{$pos+1} !== '{' ) { + } elseif ($value[$pos+1] !== '{' ) { // the string positions were changed to value-1 to correct // a fatal error coming from function substring() diff --git a/lib/plugins/sfPropelPlugin/lib/vendor/phing/types/Path.php b/lib/plugins/sfPropelPlugin/lib/vendor/phing/types/Path.php index 2205d92e58..1540535d1f 100644 --- a/lib/plugins/sfPropelPlugin/lib/vendor/phing/types/Path.php +++ b/lib/plugins/sfPropelPlugin/lib/vendor/phing/types/Path.php @@ -355,8 +355,8 @@ public static function translateFile($source) { * replacements. */ protected static function translateFileSep(&$buffer, $pos) { - if ($buffer{$pos} == '/' || $buffer{$pos} == '\\') { - $buffer{$pos} = DIRECTORY_SEPARATOR; + if ($buffer[$pos] == '/' || $buffer[$pos] == '\\') { + $buffer[$pos] = DIRECTORY_SEPARATOR; return true; } return false; diff --git a/lib/plugins/sfPropelPlugin/lib/vendor/phing/util/FileUtils.php b/lib/plugins/sfPropelPlugin/lib/vendor/phing/util/FileUtils.php index 2618831e78..f9af9aa5b4 100644 --- a/lib/plugins/sfPropelPlugin/lib/vendor/phing/util/FileUtils.php +++ b/lib/plugins/sfPropelPlugin/lib/vendor/phing/util/FileUtils.php @@ -131,11 +131,11 @@ function resolveFile($file, $filename) { // deal with absolute files if (StringHelper::startsWith($fs->getSeparator(), $filename) || - (strlen($filename) >= 2 && Character::isLetter($filename{0}) && $filename{1} === ':')) { + (strlen($filename) >= 2 && Character::isLetter($filename[0]) && $filename[1] === ':')) { return new PhingFile($this->normalize($filename)); } - if (strlen($filename) >= 2 && Character::isLetter($filename{0}) && $filename{1} === ':') { + if (strlen($filename) >= 2 && Character::isLetter($filename[0]) && $filename[1] === ':') { return new PhingFile($this->normalize($filename)); } @@ -182,7 +182,7 @@ function normalize($path) { // make sure we are dealing with an absolute path if (!StringHelper::startsWith(DIRECTORY_SEPARATOR, $path) - && !(strlen($path) >= 2 && Character::isLetter($path{0}) && $path{1} === ':')) { + && !(strlen($path) >= 2 && Character::isLetter($path[0]) && $path[1] === ':')) { throw new IOException("$path is not an absolute path"); } @@ -191,7 +191,7 @@ function normalize($path) { // Eliminate consecutive slashes after the drive spec - if (strlen($path) >= 2 && Character::isLetter($path{0}) && $path{1} === ':') { + if (strlen($path) >= 2 && Character::isLetter($path[0]) && $path[1] === ':') { $dosWithDrive = true; $ca = str_replace('/', '\\', $path); @@ -221,7 +221,7 @@ function normalize($path) { if (strlen($path) == 1) { $root = DIRECTORY_SEPARATOR; $path = ""; - } else if ($path{1} == DIRECTORY_SEPARATOR) { + } else if ($path[1] == DIRECTORY_SEPARATOR) { // UNC drive $root = DIRECTORY_SEPARATOR.DIRECTORY_SEPARATOR; $path = substr($path, 2); diff --git a/lib/plugins/sfPropelPlugin/lib/vendor/phing/util/PathTokenizer.php b/lib/plugins/sfPropelPlugin/lib/vendor/phing/util/PathTokenizer.php index 1e24c98d92..4f0f3e3ded 100755 --- a/lib/plugins/sfPropelPlugin/lib/vendor/phing/util/PathTokenizer.php +++ b/lib/plugins/sfPropelPlugin/lib/vendor/phing/util/PathTokenizer.php @@ -179,7 +179,7 @@ public function nextToken() { - if (strlen($token) === 1 && Character::isLetter($token{0}) + if (strlen($token) === 1 && Character::isLetter($token[0]) && $this->dosStyleFilesystem diff --git a/lib/plugins/sfPropelPlugin/lib/vendor/phing/util/StringHelper.php b/lib/plugins/sfPropelPlugin/lib/vendor/phing/util/StringHelper.php index 5d4bfd7a31..4d25d37555 100644 --- a/lib/plugins/sfPropelPlugin/lib/vendor/phing/util/StringHelper.php +++ b/lib/plugins/sfPropelPlugin/lib/vendor/phing/util/StringHelper.php @@ -60,7 +60,7 @@ public static function toCharArray($str) { $ret=array(); $len=strlen($str); for ($i=0; $i < $len; $i++) { - $ret[] = $str{$i}; + $ret[] = $str[$i]; } return $ret; } @@ -177,7 +177,7 @@ public static function substring($string, $startpos, $endpos = -1) { trigger_error("substring(), Endindex out of bounds must be $startposgetRetrieveMethodName()."s(\$pks, \$con = null) $i = 0; foreach($table->getPrimaryKey() as $col) { $script .= " - \$c{$i} = \$criteria->getNewCriterion(".$this->getPeerClassname($col).", \$pk[$i], Criteria::EQUAL);"; + \$c[$i] = \$criteria->getNewCriterion(".$this->getPeerClassname($col).", \$pk[$i], Criteria::EQUAL);"; $j = $i - 1; if ($i > 0) { $script .= " - \$c{$j}->addAnd(\$c{$i});"; + \$c[$j]->addAnd(\$c[$i]);"; } /* if $i > 0 */ $i++; } /* foreach */ diff --git a/lib/plugins/sfPropelPlugin/lib/vendor/propel-generator/classes/propel/engine/database/transform/XmlToAppData.php b/lib/plugins/sfPropelPlugin/lib/vendor/propel-generator/classes/propel/engine/database/transform/XmlToAppData.php index 7bc7739d13..e7e24ae957 100644 --- a/lib/plugins/sfPropelPlugin/lib/vendor/propel-generator/classes/propel/engine/database/transform/XmlToAppData.php +++ b/lib/plugins/sfPropelPlugin/lib/vendor/propel-generator/classes/propel/engine/database/transform/XmlToAppData.php @@ -180,7 +180,7 @@ public function startElement($name, $attributes) { $this->isForReferenceOnly = ($isForRefOnly !== null ? (strtolower($isForRefOnly) === "true") : true); // defaults to TRUE } - if ($xmlFile{0} != '/') { + if ($xmlFile[0] != '/') { $f = new PhingFile($this->currentXmlFile); $xf = new PhingFile($f->getParent(), $xmlFile); $xmlFile = $xf->getPath(); diff --git a/lib/plugins/sfPropelPlugin/lib/vendor/propel-generator/classes/propel/phing/AbstractPropelDataModelTask.php b/lib/plugins/sfPropelPlugin/lib/vendor/propel-generator/classes/propel/phing/AbstractPropelDataModelTask.php index 1760a72c3a..e75cb5eace 100644 --- a/lib/plugins/sfPropelPlugin/lib/vendor/propel-generator/classes/propel/phing/AbstractPropelDataModelTask.php +++ b/lib/plugins/sfPropelPlugin/lib/vendor/propel-generator/classes/propel/phing/AbstractPropelDataModelTask.php @@ -369,7 +369,7 @@ protected function getPlatformForTargetDatabase() // This is a slight hack to workaround camel case inconsistencies for the DDL classes. // Basically, we want to turn ?.?.?.sqliteDDLBuilder into ?.?.?.SqliteDDLBuilder $lastdotpos = strrpos($classpath, '.'); - if ($lastdotpos) $classpath{$lastdotpos+1} = strtoupper($classpath{$lastdotpos+1}); + if ($lastdotpos) $classpath[$lastdotpos+1] = strtoupper($classpath[$lastdotpos+1]); else ucfirst($classpath); if (empty($classpath)) { diff --git a/lib/plugins/sfPropelPlugin/lib/vendor/propel/validator/MatchValidator.php b/lib/plugins/sfPropelPlugin/lib/vendor/propel/validator/MatchValidator.php index 810cccb45d..05b1fbfff6 100644 --- a/lib/plugins/sfPropelPlugin/lib/vendor/propel/validator/MatchValidator.php +++ b/lib/plugins/sfPropelPlugin/lib/vendor/propel/validator/MatchValidator.php @@ -61,7 +61,7 @@ class MatchValidator implements BasicValidator private function prepareRegexp($exp) { // remove surrounding '/' marks so that they don't get escaped in next step - if ($exp{0} !== '/' || $exp{strlen($exp)-1} !== '/' ) { + if ($exp[0] !== '/' || $exp[strlen($exp)-1] !== '/' ) { $exp = '/' . $exp . '/'; } diff --git a/lib/plugins/sfPropelPlugin/lib/vendor/propel/validator/NotMatchValidator.php b/lib/plugins/sfPropelPlugin/lib/vendor/propel/validator/NotMatchValidator.php index 352da65af8..ad91370667 100644 --- a/lib/plugins/sfPropelPlugin/lib/vendor/propel/validator/NotMatchValidator.php +++ b/lib/plugins/sfPropelPlugin/lib/vendor/propel/validator/NotMatchValidator.php @@ -59,7 +59,7 @@ class NotMatchValidator implements BasicValidator private function prepareRegexp($exp) { // remove surrounding '/' marks so that they don't get escaped in next step - if ($exp{0} !== '/' || $exp{strlen($exp)-1} !== '/' ) { + if ($exp[0] !== '/' || $exp[strlen($exp)-1] !== '/' ) { $exp = '/' . $exp . '/'; } diff --git a/lib/request/sfWebRequest.class.php b/lib/request/sfWebRequest.class.php index d3d666178a..2a257daaac 100644 --- a/lib/request/sfWebRequest.class.php +++ b/lib/request/sfWebRequest.class.php @@ -878,7 +878,7 @@ public function getCookie($name, $defaultValue = null) if (isset($_COOKIE[$name])) { - $retval = get_magic_quotes_gpc() ? sfToolkit::stripslashesDeep($_COOKIE[$name]) : $_COOKIE[$name]; + $retval = $_COOKIE[$name]; } return $retval; @@ -1162,7 +1162,7 @@ protected function parseRequestParameters() protected function loadParameters() { // GET parameters - $this->getParameters = get_magic_quotes_gpc() ? sfToolkit::stripslashesDeep($_GET) : $_GET; + $this->getParameters = $_GET; $this->parameterHolder->add($this->getParameters); // additional parameters @@ -1170,7 +1170,7 @@ protected function loadParameters() $this->parameterHolder->add($this->requestParameters); // POST parameters - $this->postParameters = get_magic_quotes_gpc() ? sfToolkit::stripslashesDeep($_POST) : $_POST; + $this->postParameters = $_POST; $this->parameterHolder->add($this->postParameters); // move symfony parameters to attributes (parameters prefixed with _sf_) diff --git a/lib/util/sfFinder.class.php b/lib/util/sfFinder.class.php index 6fb1b030a9..f46839838c 100644 --- a/lib/util/sfFinder.class.php +++ b/lib/util/sfFinder.class.php @@ -113,7 +113,7 @@ public function setType($name) */ protected function to_regex($str) { - if ($str{0} == '/' && $str{strlen($str) - 1} == '/') + if ($str[0] == '/' && $str[strlen($str) - 1] == '/') { return $str; } @@ -585,10 +585,10 @@ protected function exec_ok($dir, $entry) public static function isPathAbsolute($path) { - if ($path{0} == '/' || $path{0} == '\\' || - (strlen($path) > 3 && ctype_alpha($path{0}) && - $path{1} == ':' && - ($path{2} == '\\' || $path{2} == '/') + if ($path[0] == '/' || $path[0] == '\\' || + (strlen($path) > 3 && ctype_alpha($path[0]) && + $path[1] == ':' && + ($path[2] == '\\' || $path[2] == '/') ) ) {