WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: Free CDN] Inline background images check ignored (1 post)

  1. scribu
    Member
    Posted 4 years ago #

    Replace this:

    // background images
                $regex = '/style\s*=\s*(?:".*?\s*\(\s*\'(.*?)\'\s*\).*?")/si';
                $html = $this->document->save();
                preg_match_all($regex, $html, $matches);
                foreach ($matches[1] as $url)
                {
                    $html = str_replace($matches[1], $this->rewrite_url($matches[1]), $html);
                }

    with this:

    $html = $this->document->save();
    
                // background images
                if ($this->options['apply']['bgr'])
                {
    	        $regex = '/style\s*=\s*(?:".*?\s*\(\s*\'(.*?)\'\s*\).*?")/si';
        	        preg_match_all($regex, $html, $matches);
    
        	        foreach ($matches[1] as $url)
        	        {
        	            $html = str_replace($matches[1], $this->rewrite_url($matches[1]), $html);
        	        }
        	    }

    http://wordpress.org/extend/plugins/free-cdn/

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags