Open phikai opened 10 years ago
Remove the two equal signs =
from the regex patterns fixes this.
This might make the RegEx a little more wide open, but the extension filter seems pretty protective. I can't really imagine a scenario where this breaks it.
In other words this:
public function filter( $content ) {
return preg_replace( "#=([\"'])(https?://{$this->site_domain})?/([^/](?:(?!\\1).)+)\.(" . implode( '|', $this->extensions ) . ")(\?((?:(?!\\1).)+))?\\1#", '=$1//' . $this->cdn_domain . '/$3.$4$5$1', $content );
}
Becomes:
public function filter( $content ) {
return preg_replace( "#([\"'])(https?://{$this->site_domain})?/([^/](?:(?!\\1).)+)\.(" . implode( '|', $this->extensions ) . ")(\?((?:(?!\\1).)+))?\\1#", '$1//' . $this->cdn_domain . '/$3.$4$5$1', $content );
}
In a case where you're defining a background url or other similar CSS case with the URL defined inside of a parenthesis, the regex misses these URLs. Example: