diff --git a/system/ThirdParty/Kint/Parser/XmlPlugin.php b/system/ThirdParty/Kint/Parser/XmlPlugin.php index 4e5671fb7273..a5a31abd4361 100644 --- a/system/ThirdParty/Kint/Parser/XmlPlugin.php +++ b/system/ThirdParty/Kint/Parser/XmlPlugin.php @@ -113,11 +113,6 @@ protected static function xmlToSimpleXML(string $var, ?string $parent_path): ?ar /** * Get the DOMDocument info. * - * The documentation of DOMDocument::loadXML() states that while you can - * call it statically, it will give an E_STRICT warning. On my system it - * actually gives an E_DEPRECATED warning, but it works so we'll just add - * an error-silencing '@' to the access path. - * * If it errors loading then we wouldn't have gotten this far in the first place. * * @psalm-param non-empty-string $var The XML string diff --git a/system/ThirdParty/Kint/Zval/BlobValue.php b/system/ThirdParty/Kint/Zval/BlobValue.php index cfee55e60ac8..ff5a6a24cfc9 100644 --- a/system/ThirdParty/Kint/Zval/BlobValue.php +++ b/system/ThirdParty/Kint/Zval/BlobValue.php @@ -74,8 +74,11 @@ class BlobValue extends Value * windows-125x and iso-8859-x which have practically undetectable * differences because they use every single byte available. * - * This is *NOT* reliable and should not be trusted implicitly. As - * with char_encodings, the order of the charsets is significant. + * This is *NOT* reliable and should not be trusted implicitly. Since it + * works by triggering and suppressing conversion warnings, your error + * handler may complain. + * + * As with char_encodings, the order of the charsets is significant. * * This depends on the iconv extension */ @@ -182,6 +185,8 @@ public static function detectEncoding(string $string) if (\function_exists('iconv')) { foreach (self::$legacy_encodings as $encoding) { + // Iconv detection works by triggering + // "Detected an illegal character in input string" warnings if (@\iconv($encoding, $encoding, $string) === $string) { return $encoding; } diff --git a/system/ThirdParty/Kint/Zval/Representation/SplFileInfoRepresentation.php b/system/ThirdParty/Kint/Zval/Representation/SplFileInfoRepresentation.php index 607877e5aee8..44980d7e359a 100644 --- a/system/ThirdParty/Kint/Zval/Representation/SplFileInfoRepresentation.php +++ b/system/ThirdParty/Kint/Zval/Representation/SplFileInfoRepresentation.php @@ -28,6 +28,7 @@ namespace Kint\Zval\Representation; use Kint\Utils; +use RuntimeException; use SplFileInfo; class SplFileInfoRepresentation extends Representation @@ -53,24 +54,30 @@ public function __construct(SplFileInfo $fileInfo) { parent::__construct('SplFileInfo'); - if ($fileInfo->getRealPath()) { - $this->realpath = $fileInfo->getRealPath(); - $this->perms = $fileInfo->getPerms(); - $this->size = $fileInfo->getSize(); - $this->owner = $fileInfo->getOwner(); - $this->group = $fileInfo->getGroup(); - $this->ctime = $fileInfo->getCTime(); - $this->mtime = $fileInfo->getMTime(); - } - $this->path = $fileInfo->getPathname(); - $this->is_dir = $fileInfo->isDir(); - $this->is_file = $fileInfo->isFile(); - $this->is_link = $fileInfo->isLink(); + try { + if ($fileInfo->getRealPath()) { + $this->perms = $fileInfo->getPerms(); + $this->size = $fileInfo->getSize(); + $this->owner = $fileInfo->getOwner(); + $this->group = $fileInfo->getGroup(); + $this->ctime = $fileInfo->getCTime(); + $this->mtime = $fileInfo->getMTime(); + $this->realpath = $fileInfo->getRealPath(); + } + + $this->is_dir = $fileInfo->isDir(); + $this->is_file = $fileInfo->isFile(); + $this->is_link = $fileInfo->isLink(); - if ($this->is_link) { - $this->linktarget = $fileInfo->getLinkTarget(); + if ($this->is_link) { + $this->linktarget = $fileInfo->getLinkTarget(); + } + } catch (RuntimeException $e) { + if (false === \strpos($e->getMessage(), ' open_basedir ')) { + throw $e; + } } switch ($this->perms & 0xF000) { diff --git a/system/ThirdParty/Kint/init.php b/system/ThirdParty/Kint/init.php index 4c3a22bb500b..7605415b6e6e 100644 --- a/system/ThirdParty/Kint/init.php +++ b/system/ThirdParty/Kint/init.php @@ -53,8 +53,12 @@ if (isset($_SERVER['DOCUMENT_ROOT'])) { Kint::$app_root_dirs = [ $_SERVER['DOCUMENT_ROOT'] => '', - \realpath($_SERVER['DOCUMENT_ROOT']) => '', ]; + + // Suppressed for unreadable document roots (related to open_basedir) + if (false !== @\realpath($_SERVER['DOCUMENT_ROOT'])) { + Kint::$app_root_dirs[\realpath($_SERVER['DOCUMENT_ROOT'])] = ''; + } } Utils::composerSkipFlags(); diff --git a/user_guide_src/source/changelogs/v4.3.0.rst b/user_guide_src/source/changelogs/v4.3.0.rst index 4ea3b567cf68..2fe99ab82722 100644 --- a/user_guide_src/source/changelogs/v4.3.0.rst +++ b/user_guide_src/source/changelogs/v4.3.0.rst @@ -322,7 +322,7 @@ Others - **Validation:** Added Closure validation rule. See :ref:`validation-using-closure-rule` for details. - **Config:** Now you can specify Composer packages to auto-discover manually. See :ref:`Code Modules `. - **Config:** Added ``Config\Session`` class to handle session configuration. -- **Debug:** Kint has been updated to 5.0.1. +- **Debug:** Kint has been updated to 5.0.2. - **Request:** Added new ``$request->getRawInputVar()`` method to return a specified variable from raw stream. See :ref:`Retrieving Raw data `. - **Request:** Added new ``$request->is()`` method to query the request type. See :ref:`Determining Request Type `.