mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-07 16:44:20 +01:00
fixed stylesheet was added multiple times and no longer break if an images was not found or empty
This commit is contained in:
parent
5406f80fd6
commit
fef98ac2ed
@ -34,10 +34,11 @@ foreach($args as $path)
|
||||
{
|
||||
if (!preg_match('|^([^/]+)/.*/(.*).svg$|', $path, $matches) || !($svg = file_get_contents($path)))
|
||||
{
|
||||
die("SVG image $path NOT found!\n");
|
||||
error_log("SVG image $path NOT found or empty!\n");
|
||||
continue;
|
||||
}
|
||||
// remove evtl. existing old stylesheet
|
||||
$svg = preg_replace("|<?xml-stylesheet[^?]+?>\n|", '', $svg);
|
||||
$svg = preg_replace("|<\\?xml-stylesheet[^?]+\\?>\n?|", '', $svg);
|
||||
// add stylesheet
|
||||
$style_url = rel_path($stylesheet, $path);
|
||||
$svg = preg_replace('|<svg|', '<?xml-stylesheet type="text/css" href="'.$style_url.'" ?>'."\n".'<svg', $svg);
|
||||
|
Loading…
Reference in New Issue
Block a user