Passed
Push — release_2_1 ( daeab2...a48ea7 )
by Stefan
09:14
created
web/lib/admin/OptionParser.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
                 $optionClass = \core\Options::instance();
102 102
                 $optionProps = $optionClass->optionType($optiontype);
103 103
                 $allowedValues = explode(',', substr($optionProps["flags"], 7));
104
-                if (in_array($incomingBinary,$allowedValues))  {
104
+                if (in_array($incomingBinary, $allowedValues)) {
105 105
                     return TRUE;
106 106
                 }
107 107
                 return FALSE;
@@ -347,14 +347,14 @@  discard block
 block discarded – undo
347 347
                 case \core\Options::TYPECODE_TEXT:
348 348
                 case \core\Options::TYPECODE_COORDINATES:
349 349
                 case \core\Options::TYPECODE_INTEGER:
350
-                    $varName = $listOfEntries["$objId-" . self::VALIDATOR_FUNCTIONS[$optioninfo['type']]['field']];
350
+                    $varName = $listOfEntries["$objId-".self::VALIDATOR_FUNCTIONS[$optioninfo['type']]['field']];
351 351
                     if (!empty($varName)) {
352 352
                         $content = call_user_func_array([$this->validator, self::VALIDATOR_FUNCTIONS[$optioninfo['type']]['function']], array_merge([$varName], self::VALIDATOR_FUNCTIONS[$optioninfo['type']]['extraarg']));
353 353
                         break;
354 354
                     }
355 355
                     continue 2;
356 356
                 case \core\Options::TYPECODE_BOOLEAN:
357
-                    $varName = $listOfEntries["$objId-" . \core\Options::TYPECODE_BOOLEAN];
357
+                    $varName = $listOfEntries["$objId-".\core\Options::TYPECODE_BOOLEAN];
358 358
                     if (!empty($varName)) {
359 359
                         $contentValid = $this->validator->boolean($varName);
360 360
                         if ($contentValid) {
@@ -367,7 +367,7 @@  discard block
 block discarded – undo
367 367
                     }
368 368
                     continue 2;
369 369
                 case \core\Options::TYPECODE_STRING:
370
-                    $previsionalContent = $listOfEntries["$objId-" . \core\Options::TYPECODE_STRING];
370
+                    $previsionalContent = $listOfEntries["$objId-".\core\Options::TYPECODE_STRING];
371 371
                     if (!empty(trim($previsionalContent))) {
372 372
                         $content = $this->furtherStringChecks($objValue, $previsionalContent, $bad);
373 373
                         if ($content === FALSE) {
@@ -378,7 +378,7 @@  discard block
 block discarded – undo
378 378
                     continue 2;
379 379
                     
380 380
                 case \core\Options::TYPECODE_ENUM_OPENROAMING:
381
-                    $previsionalContent = $listOfEntries["$objId-" . \core\Options::TYPECODE_ENUM_OPENROAMING];
381
+                    $previsionalContent = $listOfEntries["$objId-".\core\Options::TYPECODE_ENUM_OPENROAMING];
382 382
                     if (!empty($previsionalContent)) {
383 383
                         $content = $this->furtherStringChecks($objValue, $previsionalContent, $bad);
384 384
                         if ($content === FALSE) {
@@ -389,15 +389,15 @@  discard block
 block discarded – undo
389 389
                     continue 2;    
390 390
                 case \core\Options::TYPECODE_FILE:
391 391
                     // this is either actually an uploaded file, or a reference to a DB entry of a previously uploaded file
392
-                    $reference = $listOfEntries["$objId-" . \core\Options::TYPECODE_STRING];
392
+                    $reference = $listOfEntries["$objId-".\core\Options::TYPECODE_STRING];
393 393
                     if (!empty($reference)) { // was already in, by ROWID reference, extract
394 394
                         // ROWID means it's a multi-line string (simple strings are inline in the form; so allow whitespace)
395 395
                         $content = $this->validator->string(urldecode($reference), TRUE);
396 396
                         break;
397 397
                     }
398
-                    $fileName = $listOfEntries["$objId-" . \core\Options::TYPECODE_FILE] ?? "";
398
+                    $fileName = $listOfEntries["$objId-".\core\Options::TYPECODE_FILE] ?? "";
399 399
                     if ($fileName != "") { // let's do the download
400
-                        $rawContent = \core\common\OutsideComm::downloadFile("file:///" . $fileName);
400
+                        $rawContent = \core\common\OutsideComm::downloadFile("file:///".$fileName);
401 401
 
402 402
                         if ($rawContent === FALSE || !$this->checkUploadSanity($objValue, $rawContent)) {
403 403
                             $bad[] = $objValue;
@@ -408,7 +408,7 @@  discard block
 block discarded – undo
408 408
                     }
409 409
                     continue 2;
410 410
                 default:
411
-                    throw new Exception("Internal Error: Unknown option type " . $objValue . "!");
411
+                    throw new Exception("Internal Error: Unknown option type ".$objValue."!");
412 412
             }
413 413
             // lang can be NULL here, if it's not a multilang attribute, or a ROWID reference. Never mind that.
414 414
             $retval[] = ["$objValue" => ["lang" => $languageFlag, "content" => $content]];
Please login to merge, or discard this patch.