Bug: breaks the url if there is a : in it
-
Just FYI, the following code:
$ogurl = explode( ':', $ogurl);
will break the url in more than 2 parts, and therefore produce the wrong url:
// if url is, say https://www.somethig.com:8080/blah $ogurl = explode( ':', $ogurl); $ogurl_part = $ogurl[1]; $ogurl = 'http:' . $ogurl_part; // The result is https://www.something.com
note that this is only a problem if the url has a
:
in it, which could be a port number or part of the query string in some cases.A way to fix it would be to limit the explode:
$ogurl = explode( ':', $ogurl, 2);
which would split in at most 2 parts.
- The topic ‘Bug: breaks the url if there is a : in it’ is closed to new replies.