Browse Source

Merge pull request #14181 from cakephp/3.x-assetUrl-null-path

Fix Notice Error: Trying to access array offset on value of type null
Mark Story 6 years ago
parent
commit
3df144ccd9
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/View/Helper/UrlHelper.php

+ 1 - 1
src/View/Helper/UrlHelper.php

@@ -174,7 +174,7 @@ class UrlHelper extends Helper
         if (!array_key_exists('plugin', $options) || $options['plugin'] !== false) {
             list($plugin, $path) = $this->_View->pluginSplit($path, false);
         }
-        if (!empty($options['pathPrefix']) && $path[0] !== '/') {
+        if (!empty($options['pathPrefix']) && (substr((string)$path, 0, 1) !== '/')) {
             $path = $options['pathPrefix'] . $path;
         }
         if (