Passed
Push — master ( 6d236c...fc8074 )
by Stefan
07:29
created
web/lib/admin/OptionParser.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 ?>
28 28
 <?php
29 29
 
30
-require_once dirname(dirname(dirname(dirname(__FILE__)))) . "/config/_config.php";
30
+require_once dirname(dirname(dirname(dirname(__FILE__))))."/config/_config.php";
31 31
 
32 32
 /**
33 33
  * This class parses HTML field input from POST and FILES and extracts valid and authorized options to be set.
@@ -345,14 +345,14 @@  discard block
 block discarded – undo
345 345
                     case \core\Options::TYPECODE_TEXT:
346 346
                     case \core\Options::TYPECODE_COORDINATES:
347 347
                     case \core\Options::TYPECODE_INTEGER:
348
-                        $varName = "$objId-" . $validators[$optioninfo['type']]['field'];
348
+                        $varName = "$objId-".$validators[$optioninfo['type']]['field'];
349 349
                         if (!empty($listOfEntries[$varName])) {
350 350
                             $content = call_user_func_array([$this->validator, $validators[$optioninfo['type']]['function']], array_merge([$listOfEntries[$varName]], $validators[$optioninfo['type']]['extraarg']));
351 351
                             break;
352 352
                         }
353 353
                         continue 2;
354 354
                     case \core\Options::TYPECODE_BOOLEAN:
355
-                        $varName = "$objId-" . \core\Options::TYPECODE_BOOLEAN;
355
+                        $varName = "$objId-".\core\Options::TYPECODE_BOOLEAN;
356 356
                         if (!empty($listOfEntries[$varName])) {
357 357
                             $contentValid = $this->validator->boolean($listOfEntries[$varName]);
358 358
                             if ($contentValid) {
@@ -365,7 +365,7 @@  discard block
 block discarded – undo
365 365
                         }
366 366
                         continue 2;
367 367
                     case \core\Options::TYPECODE_STRING:
368
-                        $previsionalContent = $listOfEntries["$objId-" . \core\Options::TYPECODE_STRING];
368
+                        $previsionalContent = $listOfEntries["$objId-".\core\Options::TYPECODE_STRING];
369 369
                         if (!empty($previsionalContent)) {
370 370
                             $content = $this->furtherStringChecks($objValue, $previsionalContent, $bad);
371 371
                             if ($content === FALSE) {
@@ -375,12 +375,12 @@  discard block
 block discarded – undo
375 375
                         }
376 376
                         continue 2;
377 377
                     case \core\Options::TYPECODE_FILE:
378
-                        if (!empty($listOfEntries["$objId-" . \core\Options::TYPECODE_STRING])) { // was already in, by ROWID reference, extract
378
+                        if (!empty($listOfEntries["$objId-".\core\Options::TYPECODE_STRING])) { // was already in, by ROWID reference, extract
379 379
                             // ROWID means it's a multi-line string (simple strings are inline in the form; so allow whitespace)
380
-                            $content = $this->validator->string(urldecode($listOfEntries["$objId-" . \core\Options::TYPECODE_STRING]), TRUE);
380
+                            $content = $this->validator->string(urldecode($listOfEntries["$objId-".\core\Options::TYPECODE_STRING]), TRUE);
381 381
                             break;
382
-                        } else if (isset($listOfEntries["$objId-" . \core\Options::TYPECODE_FILE]) && ($listOfEntries["$objId-" . \core\Options::TYPECODE_FILE] != "")) { // let's do the download
383
-                            $rawContent = \core\common\OutsideComm::downloadFile("file:///" . $listOfEntries["$objId-" . \core\Options::TYPECODE_FILE]);
382
+                        } else if (isset($listOfEntries["$objId-".\core\Options::TYPECODE_FILE]) && ($listOfEntries["$objId-".\core\Options::TYPECODE_FILE] != "")) { // let's do the download
383
+                            $rawContent = \core\common\OutsideComm::downloadFile("file:///".$listOfEntries["$objId-".\core\Options::TYPECODE_FILE]);
384 384
 
385 385
                             if ($rawContent === FALSE || !$this->checkUploadSanity($objValue, $rawContent)) {
386 386
                                 $bad[] = $objValue;
@@ -391,7 +391,7 @@  discard block
 block discarded – undo
391 391
                         }
392 392
                         continue 2;
393 393
                     default:
394
-                        throw new Exception("Internal Error: Unknown option type " . $objValue . "!");
394
+                        throw new Exception("Internal Error: Unknown option type ".$objValue."!");
395 395
                 }
396 396
                 // lang can be NULL here, if it's not a multilang attribute, or a ROWID reference. Never mind that.
397 397
                 $retval[] = ["$objValue" => ["lang" => $lang, "content" => $content]];
Please login to merge, or discard this patch.