/**
* Sanitize "theme" option.
*
* @since 1.0.0
*
* @param string
* @return string
*/
protected function sanitizeThemeOption($value)
{
// Check for safe theme names
if (V::match($value, '/^[a-z0-9_-]+$/i')) {
// Check if theme file exists
$path = self::ACE_ASSETS_PATH . 'theme-' . $value . '.js';
if (F::exists($path)) {
return $value;
}
}
return 'kirby';
}