wp4bs
Forum Replies Created
-
Forum: Plugins
In reply to: [Broken Link Checker] Local Checker apparently renders Link URLs incorrectlyHi Dmytro,
I appreciate your prompt response.
Yesterday, I had some spare time, and so I dared to dive into the plugin code. Lucky enough, and having had a closer look at the database, I found a solution for the problem.
The problem is related to a malfunction of the blc parser in conjunction with a feature of the Divi Builder. If you choose to have different contents in the same text module depending on the device type (desktop, tablet, phone), the entire content of that module gets escaped. This means that links within such a text are stored in the database as
<a href=%22https://..%22, rather than<a href="https://..".The blc parser, however, does not remove the “%22” characters from the beginning and end of the link, so the parse_url function does not recognize the string as a valid URL and therefore does not return a “scheme” key in the array that is returned. This, in turn, causes the URL to be treated as relative, so the base URL is prepended.
This small fix, placed immediately before the call to
@parse_urlin the filehtml_link.php, works in my case:if ( str_starts_with( $url, ‘%22’ ) && ( str_ends_with( $url, ‘%22’ ) ) ) $url = substr( $url, 3, -3 );After being applied, there have not been any more error messages. It would be great if you could resolve the issue in this or a similar way in one of the upcoming updates.
Please let me know if I should email this to your support team, too, or if this post is sufficient. Maybe my explanation wasn’t straightforward enough; don’t hesitate to contact me at
wordpress.dev@bsoft.de.Regards, Hanno