Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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.
  • Loading branch information...
commit 21812d6ac90550f97aff5b5bd3843a1535604779 1 parent 4f4167f
@nijel nijel authored
Showing with 6 additions and 1 deletion.
  1. +6 −1 libraries/error_report.lib.php
View
7 libraries/error_report.lib.php
@@ -58,7 +58,12 @@ function PMA_getReportData($json_encode = true) {
}
if($json_encode) {
- return json_encode($report, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES);
+ /* JSON_PRETTY_PRINT available since PHP 5.4 */
+ if (defined('JSON_PRETTY_PRINT')) {
+ return json_encode($report, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES);
+ } else {
+ return json_encode($report);
+ }
} else {
return $report;
}
Please sign in to comment.
Something went wrong with that request. Please try again.