summaryrefslogtreecommitdiffstats
path: root/application/third_party
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2017-09-18 19:55:54 +0200
committerFlorian Pritz <bluewind@xinu.at>2017-09-21 10:37:13 +0200
commit649d3b3eb41a9b02f3a4826d22ea2422db646a99 (patch)
tree5f1fbba21504bfbaf0e0297d5db4aa702c740c35 /application/third_party
parent47d144d511f8cc0c045fa8bebf6fbadc040d84de (diff)
Test: Replace unprintable characters when dumping variables
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'application/third_party')
-rwxr-xr-xapplication/third_party/test-more-php/Test-More-OO.php5
1 files changed, 5 insertions, 0 deletions
diff --git a/application/third_party/test-more-php/Test-More-OO.php b/application/third_party/test-more-php/Test-More-OO.php
index 005c7dc01..7ce9f9421 100755
--- a/application/third_party/test-more-php/Test-More-OO.php
+++ b/application/third_party/test-more-php/Test-More-OO.php
@@ -87,6 +87,11 @@ class TestMore extends TestSimple {
$ret = ob_get_clean();
$ret = preg_replace("/^[^\n]*\n/", "", $ret);
$ret = preg_replace("/\n$/", "", $ret);
+ # replace unprintable characters with questionmarks
+ $old = ini_get("mbstring.substitute_character");
+ ini_set("mbstring.substitute_character", "?");
+ $ret = mb_convert_encoding($ret, 'UTF-8', 'UTF-8');
+ ini_set("mbstring.substitute_character", $old);
return $ret;
}