mirror of
https://github.com/e107inc/e107.git
synced 2025-08-06 14:46:56 +02:00
Fix for inline editing.
This commit is contained in:
@@ -2171,9 +2171,15 @@ class e_parse extends e_parser
|
|||||||
* We use HTML-safe strings, with several characters escaped.
|
* We use HTML-safe strings, with several characters escaped.
|
||||||
*
|
*
|
||||||
* @param mixed $var
|
* @param mixed $var
|
||||||
|
* PHP variable.
|
||||||
|
* @param bool $force_object
|
||||||
|
* True: Outputs an object rather than an array when a non-associative
|
||||||
|
* array is used. Especially useful when the recipient of the output
|
||||||
|
* is expecting an object and the array is empty.
|
||||||
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function toJSON($var)
|
public function toJSON($var, $force_object = false)
|
||||||
{
|
{
|
||||||
// The PHP version cannot change within a request.
|
// The PHP version cannot change within a request.
|
||||||
static $php530;
|
static $php530;
|
||||||
@@ -2185,6 +2191,12 @@ class e_parse extends e_parser
|
|||||||
|
|
||||||
if($php530)
|
if($php530)
|
||||||
{
|
{
|
||||||
|
if($force_object === true)
|
||||||
|
{
|
||||||
|
// Encode <, >, ', &, and " using the json_encode() options parameter.
|
||||||
|
return json_encode($var, JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_AMP | JSON_HEX_QUOT | JSON_FORCE_OBJECT);
|
||||||
|
}
|
||||||
|
|
||||||
// Encode <, >, ', &, and " using the json_encode() options parameter.
|
// Encode <, >, ', &, and " using the json_encode() options parameter.
|
||||||
return json_encode($var, JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_AMP | JSON_HEX_QUOT);
|
return json_encode($var, JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_AMP | JSON_HEX_QUOT);
|
||||||
}
|
}
|
||||||
|
@@ -3919,7 +3919,7 @@ class e_form
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$source = e107::getParser()->toJSON($jsonArray);
|
$source = e107::getParser()->toJSON($jsonArray, true);
|
||||||
|
|
||||||
$mode = preg_replace('/[^\w]/', '', vartrue($_GET['mode'], ''));
|
$mode = preg_replace('/[^\w]/', '', vartrue($_GET['mode'], ''));
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user