1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-12 19:54:12 +02:00

[ticket/10824] Switch to new namespace for json sanitizer

PHPBB3-10824
This commit is contained in:
Marc Alexander
2020-01-20 20:09:10 +01:00
parent 27c69c2740
commit 93949d1be4
6 changed files with 26 additions and 25 deletions

View File

@@ -1,24 +1,25 @@
<?php
declare(strict_types=1);
/**
*
* This file is part of the phpBB Forum Software package.
*
* @copyright (c) phpBB Limited <https://www.phpbb.com>
* @license GNU General Public License, version 2 (GPL-2.0)
*
* For full copyright and license information, please see
* the docs/CREDITS.txt file.
*
*/
*
* This file is part of the phpBB Forum Software package.
*
* @copyright (c) phpBB Limited <https://www.phpbb.com>
* @license GNU General Public License, version 2 (GPL-2.0)
*
* For full copyright and license information, please see
* the docs/CREDITS.txt file.
*
*/
namespace phpbb;
namespace phpbb\json;
use phpbb\request\type_cast_helper;
/**
* JSON sanitizer class
*/
class json_sanitizer
* JSON sanitizer class
*/
class sanitizer
{
/**
* Sanitize json data
@@ -27,7 +28,7 @@ class json_sanitizer
*
* @return array Sanitized data
*/
static public function sanitize($data)
static public function sanitize(array $data) : array
{
if (!empty($data))
{
@@ -48,7 +49,7 @@ class json_sanitizer
*
* @return array Data array
*/
static public function decode($json)
static public function decode(string $json) : array
{
$data = json_decode($json, true);
return !empty($data) ? self::sanitize($data) : [];