Mercurial > hg > isophonics-drupal-site
diff vendor/symfony/http-kernel/Debug/FileLinkFormatter.php @ 17:129ea1e6d783
Update, including to Drupal core 8.6.10
author | Chris Cannam |
---|---|
date | Thu, 28 Feb 2019 13:21:36 +0000 |
parents | 1fec387a4317 |
children |
line wrap: on
line diff
--- a/vendor/symfony/http-kernel/Debug/FileLinkFormatter.php Tue Jul 10 15:07:59 2018 +0100 +++ b/vendor/symfony/http-kernel/Debug/FileLinkFormatter.php Thu Feb 28 13:21:36 2019 +0000 @@ -34,9 +34,9 @@ public function __construct($fileLinkFormat = null, RequestStack $requestStack = null, $baseDir = null, $urlFormat = null) { $fileLinkFormat = $fileLinkFormat ?: ini_get('xdebug.file_link_format') ?: get_cfg_var('xdebug.file_link_format'); - if ($fileLinkFormat && !is_array($fileLinkFormat)) { - $i = strpos($f = $fileLinkFormat, '&', max(strrpos($f, '%f'), strrpos($f, '%l'))) ?: strlen($f); - $fileLinkFormat = array(substr($f, 0, $i)) + preg_split('/&([^>]++)>/', substr($f, $i), -1, PREG_SPLIT_DELIM_CAPTURE); + if ($fileLinkFormat && !\is_array($fileLinkFormat)) { + $i = strpos($f = $fileLinkFormat, '&', max(strrpos($f, '%f'), strrpos($f, '%l'))) ?: \strlen($f); + $fileLinkFormat = [substr($f, 0, $i)] + preg_split('/&([^>]++)>/', substr($f, $i), -1, PREG_SPLIT_DELIM_CAPTURE); } $this->fileLinkFormat = $fileLinkFormat; @@ -50,26 +50,32 @@ if ($fmt = $this->getFileLinkFormat()) { for ($i = 1; isset($fmt[$i]); ++$i) { if (0 === strpos($file, $k = $fmt[$i++])) { - $file = substr_replace($file, $fmt[$i], 0, strlen($k)); + $file = substr_replace($file, $fmt[$i], 0, \strlen($k)); break; } } - return strtr($fmt[0], array('%f' => $file, '%l' => $line)); + return strtr($fmt[0], ['%f' => $file, '%l' => $line]); } return false; } + /** + * @internal + */ public function serialize() { return serialize($this->getFileLinkFormat()); } + /** + * @internal + */ public function unserialize($serialized) { if (\PHP_VERSION_ID >= 70000) { - $this->fileLinkFormat = unserialize($serialized, array('allowed_classes' => false)); + $this->fileLinkFormat = unserialize($serialized, ['allowed_classes' => false]); } else { $this->fileLinkFormat = unserialize($serialized); } @@ -99,10 +105,10 @@ return; } - return array( - $request->getSchemeAndHttpHost().$request->getBaseUrl().$this->urlFormat, - $this->baseDir.DIRECTORY_SEPARATOR, '', - ); + return [ + $request->getSchemeAndHttpHost().$request->getBasePath().$this->urlFormat, + $this->baseDir.\DIRECTORY_SEPARATOR, '', + ]; } } }