?
avatar HLeithner
HLeithner
23 Jul 2016

Steps to reproduce the issue

Insert the following HTML code to your template

<div id='bg-image' style='background-image:url(database/bg-home.jpg);'></div>

Show the page with SEF feature on and check the source code.

Expected result

<div id='bg-image' style='background-image:url(database/bg-home.jpg);'></div>

Actual result

<div id='bg-image' style="background-image: url('/database/bg-home.jpg');'></div>

System information (as much as possible)

In plugins/system/sef/sef.php in Row 153 you find this PHP-Code

        // Replace all unknown protocols in CSS background image.
        if (strpos($buffer, 'style=') !== false)
        {
            $regex  = '#style=\s*[\'\"](.*):\s*url\s*\([\'\"]?(?!/|' . $protocols . '|\#)([^\)\'\"]+)[\'\"]?\)#m';
            $buffer = preg_replace($regex, 'style="$1: url(\'' . $base . '$2$3\')', $buffer);
            $this->checkBuffer($buffer);
        }

This will replace style=' with style=" and ignores the old close char '

avatar HLeithner HLeithner - open - 23 Jul 2016
avatar ggppdk
ggppdk - comment - 23 Jul 2016

I think had noticed this 2 years ago ?? this is old code
and since i was careful not to trigger the bug

@ HLeithner
I have made a PR for it, please test

avatar brianteeman
brianteeman - comment - 3 Aug 2016

Closed as we have a PR for testing #11266


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/11264.

avatar brianteeman brianteeman - close - 3 Aug 2016
avatar brianteeman brianteeman - change - 3 Aug 2016
Status New Closed
Closed_Date 0000-00-00 00:00:00 2016-08-03 19:46:18
Closed_By brianteeman

Add a Comment

Login with GitHub to post a comment