Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
9cea2dec10
@ -63,6 +63,7 @@ phpMyAdmin - ChangeLog
|
||||
- issue #12073 Hide edit and delete buttons when the results are not related to a table
|
||||
- issue #12083 Fixed parsing of field definition
|
||||
- issue #12081 Fixed rendering of table stats
|
||||
- issue #11705 Fixed problems with PHP on Windows on table structure
|
||||
|
||||
4.5.5.1 (2016-02-29)
|
||||
- issue #11971 CREATE UNIQUE INDEX index type is not recognized by parser.
|
||||
|
||||
@ -698,7 +698,11 @@ class Index
|
||||
$r .= '<th>' . __('Unique') . '</th>';
|
||||
$r .= '<th>' . __('Packed') . '</th>';
|
||||
$r .= '<th>' . __('Column') . '</th>';
|
||||
$r .= '<th>' . __('Cardinality') . '</th>';
|
||||
/**
|
||||
* The htmlentities is there to workaround PHP bug on Windows
|
||||
* see https://github.com/phpmyadmin/phpmyadmin/issues/11705
|
||||
*/
|
||||
$r .= '<th>' . htmlentities(__('Cardinality')) . '</th>';
|
||||
$r .= '<th>' . __('Collation') . '</th>';
|
||||
$r .= '<th>' . __('Null') . '</th>';
|
||||
$r .= '<th>' . __('Comment') . '</th>';
|
||||
|
||||
@ -364,7 +364,40 @@ class Response
|
||||
// response correctly.
|
||||
PMA_headerJSON();
|
||||
|
||||
echo json_encode($this->_JSON);
|
||||
$result = json_encode($this->_JSON);
|
||||
if ($result === false) {
|
||||
switch (json_last_error()) {
|
||||
case JSON_ERROR_NONE:
|
||||
$error = 'No errors';
|
||||
break;
|
||||
case JSON_ERROR_DEPTH:
|
||||
$error = 'Maximum stack depth exceeded';
|
||||
break;
|
||||
case JSON_ERROR_STATE_MISMATCH:
|
||||
$error = 'Underflow or the modes mismatch';
|
||||
break;
|
||||
case JSON_ERROR_CTRL_CHAR:
|
||||
$error = 'Unexpected control character found';
|
||||
break;
|
||||
case JSON_ERROR_SYNTAX:
|
||||
$error = 'Syntax error, malformed JSON';
|
||||
break;
|
||||
case JSON_ERROR_UTF8:
|
||||
$error = 'Malformed UTF-8 characters, possibly incorrectly encoded';
|
||||
break;
|
||||
default:
|
||||
$error = 'Unknown error';
|
||||
break;
|
||||
}
|
||||
echo json_encode(
|
||||
array(
|
||||
'success' => false,
|
||||
'error' => 'JSON encoding failed: ' . $error,
|
||||
)
|
||||
);
|
||||
} else {
|
||||
echo $result;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Loading…
Reference in New Issue
Block a user