Permalink
Browse files

Small typos - missing declarations

  • Loading branch information...
1 parent 15502ce commit f946643d494a4df3c8219889a484f7efe36e4207 @cdujeu cdujeu committed Jun 24, 2016
@@ -40,6 +40,9 @@
*/
class XMLWriter
{
+ /**
+ * @var bool|string
+ */
public static $headerSent = false;
/**
@@ -108,7 +108,7 @@ public static function detectServerURL($withURI = false)
{
$setUrl = ConfService::getGlobalConf("SERVER_URL");
if (!empty($setUrl)) {
- return $setUrl;
+ return (string)$setUrl;
}
if (php_sapi_name() == "cli") {
Logger::debug("WARNING, THE SERVER_URL IS NOT SET, WE CANNOT BUILD THE MAIL ADRESS WHEN WORKING IN CLI");
@@ -71,7 +71,8 @@ public static function runCreateTablesQuery($p, $file)
} else {
$parts = explode(";", $sep);
$remove = array();
- for ($i = 0; $i < count($parts); $i++) {
+ $count = count($parts);
+ for ($i = 0; $i < $count; $i++) {
$part = $parts[$i];
if (strpos($part, "BEGIN") && isSet($parts[$i + 1])) {
$parts[$i] .= ';' . $parts[$i + 1];
@@ -71,7 +71,8 @@ public static function extractHooksToDoc()
if (strpos($filename, "/plugins") === 0) {
$source = explode("/", $filename)[2];
} else {
- $source = str_replace(array("class.", ".php"), "", array_pop(explode("/", $filename)));
+ $parts = explode("/", $filename);
+ $source = str_replace(array("class.", ".php"), "", array_pop($parts));
}
if (!isSet($hooks[$hookName]["TRIGGERS"][$source])) {
$hooks[$hookName]["TRIGGERS"][$source] = array();
@@ -54,7 +54,8 @@ public static function securePath($path)
//
$path = str_replace(chr(0), "", $path);
$dirs = explode('/', $path);
- for ($i = 0; $i < count($dirs); $i++) {
+ $count = count($dirs);
+ for ($i = 0; $i < $count; $i++) {
if ($dirs[$i] == '.' or $dirs[$i] == '..') {
$dirs[$i] = '';
}
@@ -160,7 +161,8 @@ public static function sanitize($s, $level = InputFilter::SANITIZE_HTML, $expand
$s = ' ' . $s;
//begin removal
- /**/ //remove comment blocks
+ //remove comment blocks
+ $pos = []; $len = [];
while (stripos($s, '<!--') > 0) {
$pos[1] = stripos($s, '<!--');
$pos[2] = stripos($s, '-->', $pos[1]);
@@ -169,10 +171,12 @@ public static function sanitize($s, $level = InputFilter::SANITIZE_HTML, $expand
$s = str_replace($x, '', $s);
}
- /**/ //remove tags with content between them
+ //remove tags with content between them
if (strlen($expand) > 0) {
$e = explode('|', $expand);
- for ($i = 0; $i < count($e); $i++) {
+ $pos = []; $len = [];
+ $eLength = count($e);
+ for ($i = 0; $i < $eLength; $i++) {
while (stripos($s, '<' . $e[$i]) > 0) {
$len[1] = strlen('<' . $e[$i]);
$pos[1] = stripos($s, '<' . $e[$i]);
@@ -348,6 +348,7 @@ public function createResourceAction(ServerRequestInterface &$request, ResponseI
$notDecodedPath = TextEncoder::toUTF8($path);
$params = $request->getParsedBody();
$newAction = null;
+ $newVars = [];
if(isSet($params["copy_source"])){
$newVars["dest"] = PathUtils::forwardSlashDirname($notDecodedPath);
$newVars["targetBaseName"] = PathUtils::forwardSlashBasename($notDecodedPath);

0 comments on commit f946643

Please sign in to comment.