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

ezheidtmann created an issue.

radabass’s picture

But 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.