Passed
Push — master ( 3b5380...186947 )
by Stefan
07:29
created
web/lib/admin/OptionParser.php 1 patch
Spacing   +8 added lines, -8 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.
@@ -341,14 +341,14 @@  discard block
 block discarded – undo
341 341
                 case \core\Options::TYPECODE_TEXT:
342 342
                 case \core\Options::TYPECODE_COORDINATES:
343 343
                 case \core\Options::TYPECODE_INTEGER:
344
-                    $varName = $listOfEntries["$objId-" . self::VALIDATOR_FUNCTIONS[$optioninfo['type']]['field']];
344
+                    $varName = $listOfEntries["$objId-".self::VALIDATOR_FUNCTIONS[$optioninfo['type']]['field']];
345 345
                     if (!empty($varName)) {
346 346
                         $content = call_user_func_array([$this->validator, self::VALIDATOR_FUNCTIONS[$optioninfo['type']]['function']], array_merge([$varName], self::VALIDATOR_FUNCTIONS[$optioninfo['type']]['extraarg']));
347 347
                         break;
348 348
                     }
349 349
                     continue 2;
350 350
                 case \core\Options::TYPECODE_BOOLEAN:
351
-                    $varName = $listOfEntries["$objId-" . \core\Options::TYPECODE_BOOLEAN];
351
+                    $varName = $listOfEntries["$objId-".\core\Options::TYPECODE_BOOLEAN];
352 352
                     if (!empty($varName)) {
353 353
                         $contentValid = $this->validator->boolean($varName);
354 354
                         if ($contentValid) {
@@ -361,7 +361,7 @@  discard block
 block discarded – undo
361 361
                     }
362 362
                     continue 2;
363 363
                 case \core\Options::TYPECODE_STRING:
364
-                    $previsionalContent = $listOfEntries["$objId-" . \core\Options::TYPECODE_STRING];
364
+                    $previsionalContent = $listOfEntries["$objId-".\core\Options::TYPECODE_STRING];
365 365
                     if (!empty($previsionalContent)) {
366 366
                         $content = $this->furtherStringChecks($objValue, $previsionalContent, $bad);
367 367
                         if ($content === FALSE) {
@@ -372,15 +372,15 @@  discard block
 block discarded – undo
372 372
                     continue 2;
373 373
                 case \core\Options::TYPECODE_FILE:
374 374
                     // this is either actually an uploaded file, or a reference to a DB entry of a previously uploaded file
375
-                    $reference = $listOfEntries["$objId-" . \core\Options::TYPECODE_STRING];
375
+                    $reference = $listOfEntries["$objId-".\core\Options::TYPECODE_STRING];
376 376
                     if (!empty($reference)) { // was already in, by ROWID reference, extract
377 377
                         // ROWID means it's a multi-line string (simple strings are inline in the form; so allow whitespace)
378 378
                         $content = $this->validator->string(urldecode($reference), TRUE);
379 379
                         break;
380 380
                     }
381
-                    $fileName = $listOfEntries["$objId-" . \core\Options::TYPECODE_FILE] ?? "";
381
+                    $fileName = $listOfEntries["$objId-".\core\Options::TYPECODE_FILE] ?? "";
382 382
                     if ($fileName != "") { // let's do the download
383
-                        $rawContent = \core\common\OutsideComm::downloadFile("file:///" . $fileName);
383
+                        $rawContent = \core\common\OutsideComm::downloadFile("file:///".$fileName);
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" => $languageFlag, "content" => $content]];
Please login to merge, or discard this patch.