|
From: <pdo...@us...> - 2021-02-06 01:00:50
|
Revision: 14888
http://sourceforge.net/p/squirrelmail/code/14888
Author: pdontthink
Date: 2021-02-06 01:00:48 +0000 (Sat, 06 Feb 2021)
Log Message:
-----------
Stop using curly braces
Modified Paths:
--------------
branches/SM-1_4-STABLE/squirrelmail/functions/mime.php
branches/SM-1_4-STABLE/squirrelmail/functions/page_header.php
branches/SM-1_4-STABLE/squirrelmail/functions/strings.php
Modified: branches/SM-1_4-STABLE/squirrelmail/functions/mime.php
===================================================================
--- branches/SM-1_4-STABLE/squirrelmail/functions/mime.php 2021-02-06 00:49:08 UTC (rev 14887)
+++ branches/SM-1_4-STABLE/squirrelmail/functions/mime.php 2021-02-06 01:00:48 UTC (rev 14888)
@@ -50,7 +50,7 @@
}
if (count($flags)) {
foreach ($flags as $flag) {
- $char = strtoupper($flag{1});
+ $char = strtoupper($flag[1]);
switch ($char) {
case 'S':
if (strtolower($flag) == '\\seen') {
@@ -128,7 +128,7 @@
/* There is some information in the content info header that could be important
* in order to parse html messages. Let's get them here.
*/
-// if ($ret{0} == '<') {
+// if ($ret[0] == '<') {
// $data = sqimap_run_command ($imap_stream, "FETCH $id BODY[$ent_id.MIME]", true, $response, $message, $uid_support);
// }
} else if (preg_match('/"([^"]*)"/', $topline, $regs)) {
@@ -811,7 +811,7 @@
$iEncStart = $enc_init = false;
$cur_l = $iOffset = 0;
for($i = 0; $i < $j; ++$i) {
- switch($string{$i})
+ switch($string[$i])
{
case '"':
case '=':
@@ -833,7 +833,7 @@
$ret = '';
$iEncStart = false;
} else {
- $ret .= sprintf("=%02X",ord($string{$i}));
+ $ret .= sprintf("=%02X",ord($string[$i]));
}
break;
case '(':
@@ -863,7 +863,7 @@
}
break;
default:
- $k = ord($string{$i});
+ $k = ord($string[$i]);
if ($k > 126) {
if ($iEncStart === false) {
// do not start encoding in the middle of a string, also take the rest of the word.
@@ -897,7 +897,7 @@
$cur_l = 0;
$ret = '';
} else {
- $ret .= $string{$i};
+ $ret .= $string[$i];
}
}
}
@@ -1264,12 +1264,12 @@
$matches = Array();
$retarr = Array();
preg_match("%^(.*?)($reg)%si", substr($body, $offset), $matches);
- if (!isset($matches{0}) || !$matches{0}){
+ if (!isset($matches[0]) || !$matches[0]){
$retarr = false;
} else {
- $retarr{0} = $offset + strlen($matches{1});
- $retarr{1} = $matches{1};
- $retarr{2} = $matches{2};
+ $retarr[0] = $offset + strlen($matches[1]);
+ $retarr[1] = $matches[1];
+ $retarr[2] = $matches[2];
}
return $retarr;
}
@@ -1427,8 +1427,8 @@
/**
* Yep. So we did.
*/
- $pos += strlen($matches{1});
- if ($matches{2} == "/>"){
+ $pos += strlen($matches[1]);
+ if ($matches[2] == "/>"){
$tagtype = 3;
$pos++;
}
@@ -1485,7 +1485,7 @@
return $retary;
}
case '>':
- $attary{$attname} = '"yes"';
+ $attary[$attname] = '"yes"';
return Array($tagname, $attary, $tagtype, $lt, $pos);
break;
default:
@@ -1519,7 +1519,7 @@
}
list($pos, $attval, $match) = $regary;
$pos++;
- $attary{$attname} = "'" . $attval . "'";
+ $attary[$attname] = "'" . $attval . "'";
} else if ($quot == '"'){
$regary = sq_findnxreg($body, $pos+1, '\"');
if ($regary == false){
@@ -1527,7 +1527,7 @@
}
list($pos, $attval, $match) = $regary;
$pos++;
- $attary{$attname} = '"' . $attval . '"';
+ $attary[$attname] = '"' . $attval . '"';
} else {
/**
* These are hateful. Look for \s, or >.
@@ -1541,13 +1541,13 @@
* If it's ">" it will be caught at the top.
*/
$attval = preg_replace("/\"/s", """, $attval);
- $attary{$attname} = '"' . $attval . '"';
+ $attary[$attname] = '"' . $attval . '"';
}
} else if (preg_match("|[\w/>]|", $char)) {
/**
* That was attribute type 4.
*/
- $attary{$attname} = '"yes"';
+ $attary[$attname] = '"yes"';
} else {
/**
* An illegal character. Find next '>' and return.
@@ -1584,7 +1584,7 @@
if ($hex){
$numval = hexdec($numval);
}
- $repl{$matches[0][$i]} = chr($numval);
+ $repl[$matches[0][$i]] = chr($numval);
}
$attvalue = strtr($attvalue, $repl);
return true;
@@ -1624,7 +1624,7 @@
if (preg_match($matchtag, $tagname)){
foreach ($matchattrs as $matchattr){
if (preg_match($matchattr, $attname)){
- unset($attary{$attname});
+ unset($attary[$attname]);
continue;
}
}
@@ -1645,7 +1645,7 @@
// entities are used in the attribute value. In 99% of the cases it's there as XSS
// i.e.<div style="{ left:expʀessioɴ( alert('XSS') ) }">
$attvalue = "idiocy";
- $attary{$attname} = $attvalue;
+ $attary[$attname] = $attvalue;
}
sq_unspace($attvalue);
@@ -1668,7 +1668,7 @@
$newvalue =
preg_replace($valmatch, $valrepl, $attvalue);
if ($newvalue != $attvalue){
- $attary{$attname} = $newvalue;
+ $attary[$attname] = $newvalue;
$attvalue = $newvalue;
}
}
@@ -1678,7 +1678,7 @@
if ($attname == 'style') {
if (preg_match('/[\0-\37\200-\377]+/',$attvalue)) {
// 8bit and control characters in style attribute values can be used for XSS, remove them
- $attary{$attname} = '"disallowed character"';
+ $attary[$attname] = '"disallowed character"';
}
preg_match_all("/url\s*\((.+)\)/si",$attvalue,$aMatch);
if (count($aMatch)) {
@@ -1686,7 +1686,7 @@
// url value
$urlvalue = $sMatch;
sq_fix_url($attname, $urlvalue, $message, $id, $mailbox,"'");
- $attary{$attname} = str_replace($sMatch,$urlvalue,$attvalue);
+ $attary[$attname] = str_replace($sMatch,$urlvalue,$attvalue);
}
}
}
@@ -1697,7 +1697,7 @@
|| $attname == 'poster' || $attname == 'formaction'
|| $attname == 'background' || $attname == 'action') {
sq_fix_url($attname, $attvalue, $message, $id, $mailbox);
- $attary{$attname} = $attvalue;
+ $attary[$attname] = $attvalue;
}
}
/**
@@ -1888,7 +1888,7 @@
$bSucces = false;
$bEndTag = false;
for ($i=$pos,$iCount=strlen($body);$i<$iCount;++$i) {
- $char = $body{$i};
+ $char = $body[$i];
switch ($char) {
case '<':
$sToken = $char;
@@ -1919,7 +1919,7 @@
case '!':
if ($sToken == '<') {
// possible comment
- if (isset($body{$i+2}) && substr($body,$i,3) == '!--') {
+ if (isset($body[$i+2]) && substr($body,$i,3) == '!--') {
$i = strpos($body,'-->',$i+3);
if ($i === false) { // no end comment
$i = strlen($body);
@@ -2130,7 +2130,7 @@
}
}
if (strlen($styledef) > 0){
- $divattary{"style"} = "\"$styledef\"";
+ $divattary["style"] = "\"$styledef\"";
}
}
return $divattary;
Modified: branches/SM-1_4-STABLE/squirrelmail/functions/page_header.php
===================================================================
--- branches/SM-1_4-STABLE/squirrelmail/functions/page_header.php 2021-02-06 00:49:08 UTC (rev 14887)
+++ branches/SM-1_4-STABLE/squirrelmail/functions/page_header.php 2021-02-06 01:00:48 UTC (rev 14888)
@@ -130,7 +130,7 @@
// usage of $script_libs is discussed in the docs for this function above
//
foreach (array_unique($script_libs) as $item) {
- if ($item{0} === '<')
+ if ($item[0] === '<')
echo $item . "\n";
else if (strpos($item, '/') !== FALSE || strpos($item, '\\') !== FALSE)
echo '<script language="JavaScript" type="text/javascript" src="' . $item . '"></script>' . "\n";
Modified: branches/SM-1_4-STABLE/squirrelmail/functions/strings.php
===================================================================
--- branches/SM-1_4-STABLE/squirrelmail/functions/strings.php 2021-02-06 00:49:08 UTC (rev 14887)
+++ branches/SM-1_4-STABLE/squirrelmail/functions/strings.php 2021-02-06 01:00:48 UTC (rev 14888)
@@ -633,7 +633,7 @@
$String = '';
$j = strlen( $chars ) - 1;
while (strlen($String) < $size) {
- $String .= $chars{mt_rand(0, $j)};
+ $String .= $chars[mt_rand(0, $j)];
}
return $String;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|