Skip to content
Snippets Groups Projects
Unverified Commit ee76b0d5 authored by Seamus Lee's avatar Seamus Lee Committed by GitHub
Browse files

Merge pull request #18610 from demeritcowboy/error-recursion-recursion

drupal#119 - Avoid crash from recursion on unhandled exceptions
parents 19c712db 10e59978
No related branches found
No related tags found
No related merge requests found
......@@ -529,11 +529,14 @@ class CRM_Core_Error extends PEAR_ErrorStack {
$out = "\$$variable_name = $out";
}
else {
// use var_dump
ob_start();
var_dump($variable);
$dump = ob_get_contents();
ob_end_clean();
// Use Symfony var-dumper to avoid circular references that exhaust
// memory when using var_dump().
// Use its CliDumper since if we use the simpler `dump()` then it
// comes out as some overly decorated html which is hard to read.
$dump = (new \Symfony\Component\VarDumper\Dumper\CliDumper('php://output'))
->dump(
(new \Symfony\Component\VarDumper\Cloner\VarCloner())->cloneVar($variable),
TRUE);
$out = "\n\$$variable_name = $dump";
}
// reset if it is an array
......
......@@ -52,6 +52,7 @@
"symfony/event-dispatcher": "~3.0 || ~4.4",
"symfony/filesystem": "~3.0 || ~4.4",
"symfony/process": "~3.0 || ~4.4",
"symfony/var-dumper": "~3.0 || ~4.4",
"psr/log": "~1.0",
"symfony/finder": "~3.0 || ~4.4",
"tecnickcom/tcpdf" : "6.3.*",
......
......@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "2a5c933954791a798ec0f50db504c476",
"content-hash": "5b823c420fc0d96c61731dd45a7d2e3e",
"packages": [
{
"name": "adrienrn/php-mimetyper",
......@@ -242,7 +242,7 @@
{
"name": "Tobias Nyholm",
"email": "tobias.nyholm@gmail.com",
"homepage": "https://github.com/Nyholm"
"homepage": "https://github.com/nyholm"
},
{
"name": "Nicolas Grekas",
......@@ -3003,6 +3003,89 @@
"homepage": "https://symfony.com",
"time": "2020-04-12T14:33:46+00:00"
},
{
"name": "symfony/var-dumper",
"version": "v3.4.44",
"source": {
"type": "git",
"url": "https://github.com/symfony/var-dumper.git",
"reference": "3e31b82077039b1ea3b5a203ec1e3016606f4484"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/var-dumper/zipball/3e31b82077039b1ea3b5a203ec1e3016606f4484",
"reference": "3e31b82077039b1ea3b5a203ec1e3016606f4484",
"shasum": ""
},
"require": {
"php": "^5.5.9|>=7.0.8",
"symfony/polyfill-mbstring": "~1.0"
},
"conflict": {
"phpunit/phpunit": "<4.8.35|<5.4.3,>=5.0"
},
"require-dev": {
"ext-iconv": "*",
"twig/twig": "~1.34|~2.4"
},
"suggest": {
"ext-iconv": "To convert non-UTF-8 strings to UTF-8 (or symfony/polyfill-iconv in case ext-iconv cannot be used).",
"ext-intl": "To show region name in time zone dump",
"ext-symfony_debug": ""
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "3.4-dev"
}
},
"autoload": {
"files": [
"Resources/functions/dump.php"
],
"psr-4": {
"Symfony\\Component\\VarDumper\\": ""
},
"exclude-from-classmap": [
"/Tests/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Nicolas Grekas",
"email": "p@tchwork.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony mechanism for exploring and dumping PHP variables",
"homepage": "https://symfony.com",
"keywords": [
"debug",
"dump"
],
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2020-08-17T07:27:37+00:00"
},
{
"name": "tecnickcom/tcpdf",
"version": "6.3.5",
......@@ -3593,5 +3676,6 @@
"platform-dev": [],
"platform-overrides": {
"php": "7.1"
}
},
"plugin-api-version": "1.1.0"
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment