Procházet zdrojové kódy

Follow-up to c72ea0e

Don't use Pico::getAbsolutePath() for $config['content_dir'], just make sure the trailing slash exists. The config.php in Picos root dir should be interpreted exactly like in Pico 0.9 (the option didn't exist in Pico 0.8), thus the path isn't necessarily relative to Picos root dir
Daniel Rudolf před 9 roky
rodič
revize
c0d30d20f8
1 změnil soubory, kde provedl 4 přidání a 12 odebrání
  1. 4 12
      plugins/00-PicoDeprecated.php

+ 4 - 12
plugins/00-PicoDeprecated.php

@@ -176,19 +176,11 @@ class PicoDeprecated extends AbstractPicoPlugin
             require($this->getRootDir() . 'config.php');
 
             if (is_array($config)) {
-                if (array_key_exists('base_url', $config)) {
-                    if (!empty($config['base_url'])) {
-                        $config['base_url'] = rtrim($config['base_url'], '/') . '/';
-                    } else {
-                        unset($config['base_url']);
-                    }
+                if (isset($config['base_url'])) {
+                    $config['base_url'] = rtrim($config['base_url'], '/') . '/';
                 }
-                if (array_key_exists('content_dir', $config)) {
-                    if (!empty($config['content_dir'])) {
-                        $config['content_dir'] = $this->getAbsolutePath($config['content_dir']);
-                    } else {
-                        unset($config['content_dir']);
-                    }
+                if (isset($config['content_dir'])) {
+                    $config['content_dir'] = rtrim($config['content_dir'], '/') . '/';
                 }
 
                 $realConfig = $config + $realConfig;