You are here

public static function JsonCodec::staticToJson in N1ED - Visual editor as CKEditor plugin with Bootstrap support 8.2

Encodes and escapes JSON.

2 calls to JsonCodec::staticToJson()
FlmngrServer::flmngrRequest in src/Flmngr/FlmngrServer/FlmngrServer.php
Processes a request to file manager.
JsonCodec::toJson in src/Flmngr/FileUploaderServer/lib/JsonCodec.php
Stringifies response to JSON.

File

src/Flmngr/FileUploaderServer/lib/JsonCodec.php, line 56

Class

JsonCodec
JSON coder/decoder. Converting objects to JSON and back with fixing some common encoding errors.

Namespace

Drupal\n1ed\Flmngr\FileUploaderServer\lib

Code

public static function staticToJson($resp) {
  $json = json_encode($resp);
  $json = str_replace('\\u0000*\\u0000', '', $json);
  $json = str_replace('\\u0000', '', $json);
  return $json;
}