Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
In line 230 of `pathologic.module` we have this stanza:
if (strpos($matches[2], '//') === 0) {
if (isset($_SERVER['https']) && strtolower($_SERVER['https']) === 'on') {
$matches[2] = 'https:' . $matches[2];
}
else {
$matches[2] = 'http:' . $matches[2];
}
}
On the second line, the array subscript 'https' should be capitalized to 'HTTPS'. All keys in $_SERVER are all-caps.
I discovered this bug when I copied this check to my own module; thus I can't provide a visible consequence of this bug in pathologic.
Comments
Comment #2
radabass CreditAttribution: radabass as a volunteer commentedBut I can sir:
Imagine you are making a content in a full html field with an image with a source like this "//mysite.com/files/image.png" and you are going to the https part of your site, on the redered part of the field you can see the resulting chunk is "//mysite.com/files/image.png" and not "https://mysite.com/files/image.png" as expected.