Skip to content

Commit 21812d6

Browse files
committed
Make error reporting work with PHP older than 5.4
This is workaround for #4113 with cost of having not readable JSON shown to user in report detail.
1 parent 4f4167f commit 21812d6

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

libraries/error_report.lib.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,12 @@ function PMA_getReportData($json_encode = true) {
5858
}
5959

6060
if($json_encode) {
61-
return json_encode($report, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES);
61+
/* JSON_PRETTY_PRINT available since PHP 5.4 */
62+
if (defined('JSON_PRETTY_PRINT')) {
63+
return json_encode($report, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES);
64+
} else {
65+
return json_encode($report);
66+
}
6267
} else {
6368
return $report;
6469
}

0 commit comments

Comments
 (0)