Commit 2e9bbda7 authored by Steven Wittens's avatar Steven Wittens

- #44772: {} -> [] (in anticipation of PHP de-deprecation)

parent 3329ad92
......@@ -857,7 +857,7 @@ function format_date($timestamp, $type = 'medium', $format = '', $timezone = NUL
$max = strlen($format);
$date = '';
for ($i = 0; $i < $max; $i++) {
$c = $format{$i};
$c = $format[$i];
if (strpos('AaDFlM', $c) !== false) {
$date .= t(gmdate($c, $timestamp));
}
......
......@@ -19,7 +19,7 @@
* Check if the key is a property.
*/
function element_property($key) {
return $key{0} == '#';
return $key[0] == '#';
}
function element_properties($element) {
......@@ -30,7 +30,7 @@ function element_properties($element) {
* Check if the key is a child.
*/
function element_child($key) {
return $key{0} != '#';
return $key[0] != '#';
}
function element_children($element) {
......
......@@ -606,29 +606,29 @@ function _locale_import_tokenize_formula($formula) {
$formula = str_replace(" ", "", $formula);
$tokens = array();
for ($i = 0; $i < strlen($formula); $i++) {
if (is_numeric($formula{$i})) {
$num = $formula{$i};
if (is_numeric($formula[$i])) {
$num = $formula[$i];
$j = $i + 1;
while($j < strlen($formula) && is_numeric($formula{$j})) {
$num .= $formula{$j};
while($j < strlen($formula) && is_numeric($formula[$j])) {
$num .= $formula[$j];
$j++;
}
$i = $j - 1;
$tokens[] = $num;
}
elseif ($pos = strpos(" =<>!&|", $formula{$i})) { // We won't have a space
$next = $formula{($i+1)};
elseif ($pos = strpos(" =<>!&|", $formula[$i])) { // We won't have a space
$next = $formula[$i + 1];
switch ($pos) {
case 1:
case 2:
case 3:
case 4:
if ($next == '=') {
$tokens[] = $formula{$i} .'=';
$tokens[] = $formula[$i] .'=';
$i++;
}
else {
$tokens[] = $formula{$i};
$tokens[] = $formula[$i];
}
break;
case 5:
......@@ -637,7 +637,7 @@ function _locale_import_tokenize_formula($formula) {
$i++;
}
else {
$tokens[] = $formula{$i};
$tokens[] = $formula[$i];
}
break;
case 6:
......@@ -646,13 +646,13 @@ function _locale_import_tokenize_formula($formula) {
$i++;
}
else {
$tokens[] = $formula{$i};
$tokens[] = $formula[$i];
}
break;
}
}
else {
$tokens[] = $formula{$i};
$tokens[] = $formula[$i];
}
}
return $tokens;
......
......@@ -193,12 +193,12 @@ function truncate_utf8($string, $len, $wordsafe = FALSE, $dots = FALSE) {
return $string;
}
if ($wordsafe) {
while (($string{--$len} != ' ') && ($len > 0)) {};
while (($string[--$len] != ' ') && ($len > 0)) {};
}
if ((ord($string{$len}) < 0x80) || (ord($string{$len}) >= 0xC0)) {
if ((ord($string[$len]) < 0x80) || (ord($string[$len]) >= 0xC0)) {
return substr($string, 0, $len) . ($dots ? ' ...' : '');
}
while (ord($string{--$len}) < 0xC0) {};
while (ord($string[--$len]) < 0xC0) {};
return substr($string, 0, $len) . ($dots ? ' ...' : '');
}
......@@ -389,7 +389,7 @@ function drupal_strtolower($text) {
* Used for flipping U+C0-U+DE to U+E0-U+FD and back.
*/
function _unicode_caseflip($matches) {
return $matches[0]{0} . chr(ord($matches[0]{1}) ^ 32);
return $matches[0][0] . chr(ord($matches[0][1]) ^ 32);
}
/**
......@@ -422,7 +422,7 @@ function drupal_substr($text, $start, $length = NULL) {
$bytes = -1; $chars = -1;
while ($bytes < $strlen && $chars < $start) {
$bytes++;
$c = ord($text{$bytes});
$c = ord($text[$bytes]);
if ($c < 0x80 || $c >= 0xC0) {
$chars++;
}
......@@ -435,7 +435,7 @@ function drupal_substr($text, $start, $length = NULL) {
$bytes = $strlen; $chars = 0;
while ($bytes > 0 && $chars < $start) {
$bytes--;
$c = ord($text{$bytes});
$c = ord($text[$bytes]);
if ($c < 0x80 || $c >= 0xC0) {
$chars++;
}
......@@ -453,7 +453,7 @@ function drupal_substr($text, $start, $length = NULL) {
$bytes = $istart; $chars = 0;
while ($bytes < $strlen && $chars < $length) {
$bytes++;
$c = ord($text{$bytes});
$c = ord($text[$bytes]);
if ($c < 0x80 || $c >= 0xC0) {
$chars++;
}
......@@ -466,7 +466,7 @@ function drupal_substr($text, $start, $length = NULL) {
$length = abs($length);
$bytes = $strlen - 1; $chars = 0;
while ($bytes >= 0 && $chars < $length) {
$c = ord($text{$bytes});
$c = ord($text[$bytes]);
if ($c < 0x80 || $c >= 0xC0) {
$chars++;
}
......
......@@ -1004,7 +1004,7 @@ function _filter_autop($text) {
foreach ($chunks as $i => $chunk) {
if ($i % 2) {
// Opening or closing tag?
$open = ($chunk{1} != '/');
$open = ($chunk[1] != '/');
list($tag) = split('[ >]', substr($chunk, 2 - $open), 2);
if (!$ignore) {
if ($open) {
......
......@@ -1004,7 +1004,7 @@ function _filter_autop($text) {
foreach ($chunks as $i => $chunk) {
if ($i % 2) {
// Opening or closing tag?
$open = ($chunk{1} != '/');
$open = ($chunk[1] != '/');
list($tag) = split('[ >]', substr($chunk, 2 - $open), 2);
if (!$ignore) {
if ($open) {
......
......@@ -482,7 +482,7 @@ function search_index($sid, $type, $text) {
list($tagname) = explode(' ', $value, 2);
$tagname = drupal_strtolower($tagname);
// Closing or opening tag?
if ($tagname{0} == '/') {
if ($tagname[0] == '/') {
$tagname = substr($tagname, 1);
// If we encounter unexpected tags, reset score to avoid incorrect boosting.
if (!count($tagstack) || $tagstack[0] != $tagname) {
......
......@@ -482,7 +482,7 @@ function search_index($sid, $type, $text) {
list($tagname) = explode(' ', $value, 2);
$tagname = drupal_strtolower($tagname);
// Closing or opening tag?
if ($tagname{0} == '/') {
if ($tagname[0] == '/') {
$tagname = substr($tagname, 1);
// If we encounter unexpected tags, reset score to avoid incorrect boosting.
if (!count($tagstack) || $tagstack[0] != $tagname) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment