Use FILTER_VALIDATE_BOOLEAN to convert boolean
This commit is contained in:
parent
a9f2322d8c
commit
f0e8ad9c86
|
@ -61,12 +61,6 @@ class WCA_Test_Helper_Rest_Api_Filters {
|
||||||
$dot_notation = $request->get_param('dot_notation');
|
$dot_notation = $request->get_param('dot_notation');
|
||||||
$replacement = $request->get_param('replacement');
|
$replacement = $request->get_param('replacement');
|
||||||
|
|
||||||
if ($replacement === 'false' ) {
|
|
||||||
$replacement = false;
|
|
||||||
} else if ($replacement === 'true' ) {
|
|
||||||
$replacement = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
self::update(
|
self::update(
|
||||||
function ( $filters ) use (
|
function ( $filters ) use (
|
||||||
$endpoint,
|
$endpoint,
|
||||||
|
@ -76,7 +70,7 @@ class WCA_Test_Helper_Rest_Api_Filters {
|
||||||
$filters[] = array(
|
$filters[] = array(
|
||||||
'endpoint' => $endpoint,
|
'endpoint' => $endpoint,
|
||||||
'dot_notation' => $dot_notation,
|
'dot_notation' => $dot_notation,
|
||||||
'replacement' => $replacement,
|
'replacement' => filter_var( $replacement, FILTER_VALIDATE_BOOLEAN ),
|
||||||
'enabled' => true,
|
'enabled' => true,
|
||||||
);
|
);
|
||||||
return $filters;
|
return $filters;
|
||||||
|
|
Loading…
Reference in New Issue