mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-07 16:44:07 +01:00
quote double quotes, if replacing single quotes with double quotes
attr='Some "important" text' --> attr="Some "important" text"
This commit is contained in:
parent
cb2fe3f93c
commit
2756b9b247
@ -65,7 +65,9 @@ function send_template()
|
||||
elseif(($str = file_get_contents($path)) !== false)
|
||||
{
|
||||
// replace single quote enclosing attribute values with double quotes
|
||||
$str = preg_replace("#([a-z_-]+)='([^']*)'([ />])#i", '$1="$2"$3', $str);
|
||||
$str = preg_replace_callback("#([a-z_-]+)='([^']*)'([ />])#i", static function($matches){
|
||||
return $matches[1].'="'.str_replace('"', '"', $matches[2]).'"'.$matches[3];
|
||||
}, $str);
|
||||
|
||||
// fix <menulist...><menupopup type="select-*"/></menulist> --> <select type="select-*" .../>
|
||||
$str = preg_replace('#<menulist([^>]*)>[\r\n\s]*<menupopup([^>]+>)[\r\n\s]*</menulist>#', '<select$1$2', $str);
|
||||
|
Loading…
Reference in New Issue
Block a user