websites that end with *w.org
-
Hi
i am reporting a bug and providing a fix just in case anyone else runs into this issue.
behavior: any link with the web address ending with w.org like (somethinglaw.org, thisishow.org) gets rewritten like this (somethingl.w.org, thisish.w.org)
problem: the problem is line number 80
$buffer = preg_replace(array('|https://(.*?).w.org|','|https://(.*?).w.org|'), '//$1.w.org', $buffer);
the fix: the regular expression should account for the
.
being treated as a wildcard and so should change to\.
$buffer = preg_replace(array('|https://(.*?)\.w.org|','|https://(.*?)\.w.org|'), '//$1.w.org', $buffer);
demonstrating the issue
https://fileserver.imagebucket.net/img/k7jzj24gr7dvcnxolvofldywvk5lxysgkbtzamlole/https-broken.PNGtesting the fix
https://fileserver.imagebucket.net/img/k7jzh24gr6ca26ppiaofjbk36t3akpmgkesgama5ei/https-fixed.PNGhere is a good tutorial about the regex special characters https://www.regular-expressions.info/characters.html
here is a good tool to test your regex https://www.functions-online.com/preg_replace.html
my personal opinion: by far this is the best plugin out there that deals with mixed-content.
hope this helps!
- The topic ‘websites that end with *w.org’ is closed to new replies.