Skip to content

chore: update Kint to 5.0.2 #7054

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions system/ThirdParty/Kint/Parser/XmlPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 7 additions & 2 deletions system/ThirdParty/Kint/Zval/BlobValue.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down Expand Up @@ -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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
namespace Kint\Zval\Representation;

use Kint\Utils;
use RuntimeException;
use SplFileInfo;

class SplFileInfoRepresentation extends Representation
Expand All @@ -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) {
Expand Down
6 changes: 5 additions & 1 deletion system/ThirdParty/Kint/init.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,12 @@
if (isset($_SERVER['DOCUMENT_ROOT'])) {
Kint::$app_root_dirs = [
$_SERVER['DOCUMENT_ROOT'] => '<ROOT>',
\realpath($_SERVER['DOCUMENT_ROOT']) => '<ROOT>',
];

// Suppressed for unreadable document roots (related to open_basedir)
if (false !== @\realpath($_SERVER['DOCUMENT_ROOT'])) {
Kint::$app_root_dirs[\realpath($_SERVER['DOCUMENT_ROOT'])] = '<ROOT>';
}
}

Utils::composerSkipFlags();
Expand Down
2 changes: 1 addition & 1 deletion user_guide_src/source/changelogs/v4.3.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 <modules-specify-composer-packages>`.
- **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 <incomingrequest-retrieving-raw-data>`.
- **Request:** Added new ``$request->is()`` method to query the request type.
See :ref:`Determining Request Type <incomingrequest-is>`.
Expand Down