Sanitize CORS value before insert
This commit is contained in:
parent
5a8e26c534
commit
46685f45aa
|
@ -1556,7 +1556,16 @@ class Application_Model_Preference
|
||||||
* @param string $value
|
* @param string $value
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public static function SetAllowedCorsUrls($value) {
|
public static function SetAllowedCorsUrls($value)
|
||||||
|
{
|
||||||
|
// Trim and strip trailing slash for each entry
|
||||||
|
$value = implode(PHP_EOL, array_map(
|
||||||
|
function ($v) {
|
||||||
|
return rtrim(trim($v), '/');
|
||||||
|
},
|
||||||
|
explode(PHP_EOL, $value)
|
||||||
|
));
|
||||||
|
|
||||||
self::setValue('allowed_cors_urls', $value);
|
self::setValue('allowed_cors_urls', $value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue