mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-31 05:50:42 +02:00
- allow underscores in CSS class names / ids
- remove control characters from clean strings, and map all space characters to ASCII space (\x20) git-svn-id: file:///svn/phpbb/trunk@6932 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
@@ -967,7 +967,7 @@ parse_css_file = {PARSE_CSS_FILE}
|
||||
|
||||
// Pull out a list of classes
|
||||
$classes = array();
|
||||
if (preg_match_all('/^([a-z0-9\.,:#> \t]+?)[ \t\n]*?\{.*?\}/msi', $stylesheet, $matches))
|
||||
if (preg_match_all('/^([a-z0-9\.,:#_\->* \t]+?)[ \t\n]*?\{.*?\}/msi', $stylesheet, $matches))
|
||||
{
|
||||
$classes = $matches[1];
|
||||
}
|
||||
@@ -1266,14 +1266,14 @@ parse_css_file = {PARSE_CSS_FILE}
|
||||
else
|
||||
{
|
||||
// check whether the custom class name is valid
|
||||
if (!preg_match('/^[a-z0-9#:.\- ]+$/i', $custom_class))
|
||||
if (!preg_match('/^[a-z0-9\.,:#_\->*]+$/i', $custom_class))
|
||||
{
|
||||
trigger_error($user->lang['THEME_ERR_CLASS_CHARS'] . adm_back_link($this->u_action . "&action=edit&id=$theme_id&text_rows=$text_rows"), E_USER_WARNING);
|
||||
}
|
||||
else
|
||||
{
|
||||
// append an empty class definition to the stylesheet
|
||||
$stylesheet .= "\n$custom_class\n{\n}";
|
||||
$stylesheet .= "\n$custom_class {\n\t\n}";
|
||||
$message = $user->lang['THEME_CLASS_ADDED'];
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user