### Eclipse Workspace Patch 1.0 #P TYPO3 trunk (sgdummy) Index: t3lib/class.t3lib_div.php =================================================================== --- t3lib/class.t3lib_div.php (revision 7072) +++ t3lib/class.t3lib_div.php (working copy) @@ -390,7 +390,7 @@ * @return string Input string with potential XSS code removed */ public static function removeXSS($string) { - require_once(PATH_typo3.'contrib/RemoveXSS/RemoveXSS.php'); + require_once(PATH_typo3 . 'contrib/RemoveXSS/RemoveXSS.php'); $string = RemoveXSS::process($string); return $string; } @@ -435,7 +435,7 @@ $returnCode=''; if ($gfxConf['gif_compress'] && strtolower(substr($theFile,-4,4))=='.gif') { // GIF... if (($type=='IM' || !$type) && $gfxConf['im'] && $gfxConf['im_path_lzw']) { // IM - $cmd = self::imageMagickCommand('convert', '"'.$theFile.'" "'.$theFile.'"', $gfxConf['im_path_lzw']); + $cmd = self::imageMagickCommand('convert', '"' . $theFile . '" "' . $theFile . '"', $gfxConf['im_path_lzw']); exec($cmd); $returnCode='IM'; @@ -463,8 +463,8 @@ && $GLOBALS['TYPO3_CONF_VARS']['GFX']['im_path_lzw'] && strtolower(substr($theFile,-4,4))=='.png' && @is_file($theFile)) { // IM - $newFile = substr($theFile,0,-4).'.gif'; - $cmd = self::imageMagickCommand('convert', '"'.$theFile.'" "'.$newFile.'"', $GLOBALS['TYPO3_CONF_VARS']['GFX']['im_path_lzw']); + $newFile = substr($theFile,0,-4) . '.gif'; + $cmd = self::imageMagickCommand('convert', '"' . $theFile . '" "' . $newFile . '"', $GLOBALS['TYPO3_CONF_VARS']['GFX']['im_path_lzw']); exec($cmd); $theFile = $newFile; // unlink old file?? May be bad idea bacause TYPO3 would then recreate the file every time as TYPO3 thinks the file is not generated because it's missing!! So do not unlink $theFile here!! @@ -490,8 +490,8 @@ ) { return $theFile; } else { - $newFile = PATH_site.'typo3temp/readPG_'.md5($theFile.'|'.filemtime($theFile)).($output_png?'.png':'.gif'); - $cmd = self::imageMagickCommand('convert', '"'.$theFile.'" "'.$newFile.'"', $GLOBALS['TYPO3_CONF_VARS']['GFX']['im_path']); + $newFile = PATH_site . 'typo3temp/readPG_' . md5($theFile . '|' . filemtime($theFile)) . ($output_png?'.png':'.gif'); + $cmd = self::imageMagickCommand('convert', '"' . $theFile . '" "' . $newFile . '"', $GLOBALS['TYPO3_CONF_VARS']['GFX']['im_path']); exec($cmd); if (@is_file($newFile)) return $newFile; } @@ -538,8 +538,8 @@ if ($chars >= 4) { if(strlen($string)>$chars) { return $origChars < 0 ? - $preStr.trim(substr($string, -($chars-3))) : - trim(substr($string, 0, $chars-3)).$preStr; + $preStr . trim(substr($string, -($chars-3))) : + trim(substr($string, 0, $chars-3)) . $preStr; } } return $string; @@ -630,7 +630,7 @@ $theLine = strrev($parts[1]); } else { $afterParts = explode(' ',substr($str,$l+$p),2); - $theLine = $substr.$afterParts[0]; + $theLine = $substr . $afterParts[0]; } if (!strlen($theLine)) {break; } // Error, because this would keep us in an endless loop. } else { @@ -906,7 +906,7 @@ * @return boolean true if $item is in $list */ public static function inList($list, $item) { - return (strpos(','.$list.',', ','.$item.',')!==false ? true : false); + return (strpos(',' . $list . ',', ',' . $item . ',')!==false ? true : false); } /** @@ -996,7 +996,7 @@ */ public static function int_from_ver($verNumberStr) { $verParts = explode('.',$verNumberStr); - return intval((int)$verParts[0].str_pad((int)$verParts[1],3,'0',STR_PAD_LEFT).str_pad((int)$verParts[2],3,'0',STR_PAD_LEFT)); + return intval((int)$verParts[0] . str_pad((int)$verParts[1],3,'0',STR_PAD_LEFT) . str_pad((int)$verParts[2],3,'0',STR_PAD_LEFT)); } /** @@ -1124,10 +1124,10 @@ $nR = self::intInRange(hexdec(substr($color,1,2))+$R,0,255); $nG = self::intInRange(hexdec(substr($color,3,2))+$G,0,255); $nB = self::intInRange(hexdec(substr($color,5,2))+$B,0,255); - return '#'. - substr('0'.dechex($nR),-2). - substr('0'.dechex($nG),-2). - substr('0'.dechex($nB),-2); + return '#' . + substr('0' . dechex($nR),-2) . + substr('0' . dechex($nG),-2) . + substr('0' . dechex($nB),-2); } /** @@ -1237,17 +1237,17 @@ if ($sizeInBytes>900) { if ($sizeInBytes>900000000) { // GB $val = $sizeInBytes/(1024*1024*1024); - return number_format($val, (($val<20)?1:0), '.', '').$labelArr[3]; + return number_format($val, (($val<20)?1:0), '.', '') . $labelArr[3]; } elseif ($sizeInBytes>900000) { // MB $val = $sizeInBytes/(1024*1024); - return number_format($val, (($val<20)?1:0), '.', '').$labelArr[2]; + return number_format($val, (($val<20)?1:0), '.', '') . $labelArr[2]; } else { // KB $val = $sizeInBytes/(1024); - return number_format($val, (($val<20)?1:0), '.', '').$labelArr[1]; + return number_format($val, (($val<20)?1:0), '.', '') . $labelArr[1]; } } else { // Bytes - return $sizeInBytes.$labelArr[0]; + return $sizeInBytes . $labelArr[0]; } } @@ -1296,12 +1296,12 @@ */ public static function calcPriority($string) { $string=preg_replace('/[[:space:]]*/','',$string); // removing all whitespace - $string='+'.$string; // Ensuring an operator for the first entrance + $string='+' . $string; // Ensuring an operator for the first entrance $qm='\*\/\+-^%'; - $regex = '(['.$qm.'])(['.$qm.']?[0-9\.]*)'; + $regex = '([' . $qm . '])([' . $qm . ']?[0-9\.]*)'; // split the expression here: $reg = array(); - preg_match_all('/'.$regex.'/',$string,$reg); + preg_match_all('/' . $regex . '/',$string,$reg); reset($reg[2]); $number=0; @@ -1325,7 +1325,7 @@ } } $number = $Msign=='-' ? $number-=$buffer : $number+=$buffer; - return $err ? 'ERROR: '.$err : $number; + return $err ? 'ERROR: ' . $err : $number; } /** @@ -1343,10 +1343,10 @@ $valueLenC=strcspn($string,')'); if ($valueLenC==strlen($string) || $valueLenC < $valueLenO) { $value = self::calcPriority(substr($string,0,$valueLenC)); - $string = $value.substr($string,$valueLenC+1); + $string = $value . substr($string,$valueLenC+1); return $string; } else { - $string = substr($string,0,$valueLenO).self::calcParenthesis(substr($string,$valueLenO+1)); + $string = substr($string,0,$valueLenO) . self::calcParenthesis(substr($string,$valueLenO+1)); } // Security: $securC--; @@ -1392,7 +1392,7 @@ */ public static function slashJS($string,$extended=0,$char="'") { if ($extended) {$string = str_replace ("\\", "\\\\", $string);} - return str_replace ($char, "\\".$char, $string); + return str_replace ($char, "\\" . $char, $string); } /** @@ -1471,7 +1471,7 @@ * @return string Formatted for