summaryrefslogtreecommitdiff
path: root/run-tests.php
diff options
context:
space:
mode:
authorMatteo Beccati <mbeccati@php.net>2014-05-27 12:04:17 +0200
committerMatteo Beccati <mbeccati@php.net>2014-05-27 12:04:17 +0200
commitabfd97741056cc837918891f6f6c3662837547d0 (patch)
tree3126ba0469070ec62fa437d4e2198f28531d220b /run-tests.php
parent56bcb22afb5040d49439f0a0d238f8a013ebec48 (diff)
parent92d54f81d671f0f14a06fec7bd6f917b085253c6 (diff)
downloadphp-git-abfd97741056cc837918891f6f6c3662837547d0.tar.gz
Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4: Escape non-printable characters in the junit XML output
Diffstat (limited to 'run-tests.php')
-rwxr-xr-xrun-tests.php3
1 files changed, 3 insertions, 0 deletions
diff --git a/run-tests.php b/run-tests.php
index 207758839c..cc20febf71 100755
--- a/run-tests.php
+++ b/run-tests.php
@@ -2704,6 +2704,9 @@ function junit_mark_test_as($type, $file_name, $test_name, $time = null, $messag
junit_suite_record($suite, 'execution_time', $time);
$escaped_details = htmlspecialchars($details, ENT_QUOTES, 'UTF-8');
+ $escaped_details = preg_replace_callback('/[\0-\x08\x0B\x0C\x0E-\x1F]/', function ($c) {
+ return sprintf('[[0x%02x]]', ord($c[0]));
+ }, $escaped_details);
$escaped_message = htmlspecialchars($message, ENT_QUOTES, 'UTF-8');
$escaped_test_name = basename($file_name) . ' - ' . htmlspecialchars($test_name, ENT_QUOTES);