mirror of
https://github.com/grocy/grocy.git
synced 2025-04-30 01:55:47 +00:00
Fixed login did not work
This commit is contained in:
parent
a2b2f26628
commit
9f88dd3af3
@ -115,27 +115,4 @@ class BaseApiController extends BaseController
|
|||||||
|
|
||||||
return $this->OpenApiSpec;
|
return $this->OpenApiSpec;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static $htmlPurifierInstance = null;
|
|
||||||
|
|
||||||
protected function GetParsedAndFilteredRequestBody($request)
|
|
||||||
{
|
|
||||||
if (self::$htmlPurifierInstance == null)
|
|
||||||
{
|
|
||||||
self::$htmlPurifierInstance = new \HTMLPurifier(\HTMLPurifier_Config::createDefault());
|
|
||||||
}
|
|
||||||
|
|
||||||
$requestBody = $request->getParsedBody();
|
|
||||||
foreach ($requestBody as $key => &$value)
|
|
||||||
{
|
|
||||||
// HTMLPurifier removes boolean values (true/false), so explicitly keep them
|
|
||||||
// Maybe also possible through HTMLPurifier config (http://htmlpurifier.org/live/configdoc/plain.html)
|
|
||||||
if (!is_bool($value))
|
|
||||||
{
|
|
||||||
$value = self::$htmlPurifierInstance->purify($value);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return $requestBody;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -176,4 +176,27 @@ class BaseController
|
|||||||
|
|
||||||
return $this->render($response, $page, $data);
|
return $this->render($response, $page, $data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static $htmlPurifierInstance = null;
|
||||||
|
|
||||||
|
protected function GetParsedAndFilteredRequestBody($request)
|
||||||
|
{
|
||||||
|
if (self::$htmlPurifierInstance == null)
|
||||||
|
{
|
||||||
|
self::$htmlPurifierInstance = new \HTMLPurifier(\HTMLPurifier_Config::createDefault());
|
||||||
|
}
|
||||||
|
|
||||||
|
$requestBody = $request->getParsedBody();
|
||||||
|
foreach ($requestBody as $key => &$value)
|
||||||
|
{
|
||||||
|
// HTMLPurifier removes boolean values (true/false), so explicitly keep them
|
||||||
|
// Maybe also possible through HTMLPurifier config (http://htmlpurifier.org/live/configdoc/plain.html)
|
||||||
|
if (!is_bool($value))
|
||||||
|
{
|
||||||
|
$value = self::$htmlPurifierInstance->purify($value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $requestBody;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user