Menu

#59 Link tag regex incorrect (Fix included)

v3.0b
open
nobody
5
2008-02-29
2008-02-29
Keilaron
No

Using version 3.0.2beta.

This tag gets the following error:
<link rel="stylesheet" href="wizard/wizard.css" type="text/css" />

[29-Feb-2008 15:16:46] PHP Warning: file_get_contents(wizard/wizard.css" type="text/css) [function.file-get-contents]: failed to open stream: Invalid argument in .../html2fpdf.php on line 2211

This is due to the regex on line 2182 being incorrect. Instead of:
$regexp = '/<link rel="stylesheet".*?href="(.+?)"\\s*?\/?>/si';
It should be:
$regexp = '/<link rel="stylesheet".*?href="([^"]+?)"\\s*?\/?>/si';
What is changed is that instead of being ".+?" it is changed to "[^"]+?", meaning everything but ".

Discussion


Log in to post a comment.

MongoDB Logo MongoDB