I have an application on a website developed by a third party (and no documentation). I think it uses a combination of symfony, dompdf and others to build a "shopping cart" of pages that you can download as a PDF. Anyway, I've managed to do a number of edits to this over time, but I'm having problems with relative URLs. They are breaking and resulting in a 404. I've managed to fix those types of links when in a list with this line:
$this->content = str_replace('<li><a href="', '<li><a href="' . $this->frontUrl . '', $this->content);
But the problem still persists in links in other spots, see the bottom of this bio for a URL as an example: https://www.bipc.com/briefcasebir/web/briefcase/render.pdf?token=1619124576&filename=briefcase.pdf
I'm trying to rework this with a way to target any <a>
tags that contain relative urls and add the "frontUrl" to convert it to absolute. Maybe there's a better way? But I don't think I can fix this with javascript either since it's creating a PDF.
Any help would be appreciated. Thanks.