You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While using this library with the drupal module i noticed that absolute images in the format <img src="/myimage/image.png"> would not get translated to amp-img.
The images do not have a width or height so it has to load the images to find these.
This part in the README looked much like my problem but did not seem to be the fix i needed as it did not work after following the tips.
If you have s with https urls and they don't have height/width attributes and you are using PHP 5.6 or higher and you have not listed any certificate authorities (cafile) in your php.ini file then the library may have problems converting these to . This is because of http://php.net/manual/en/migration56.openssl.php . That link also has a work around.
When debugging i noticed the url used was http://myserver:443 which does not work as it expected htts://myserver.
The problem seems to be in this code
// Get the request scheme http, https etc.
if (empty($options['request_scheme'])) {
if (!empty($_SERVER['https'])) {
$this->options['request_scheme'] = 'https://';
} else {
$this->options['request_scheme'] = 'http://';
}
}
where $_SERVER['https'] should be $_SERVER['HTTPS'] (this solved it for me)
Also not sure if you want to support the edgecase noted in the PHP doc by checking for "off" as well
'HTTPS'
Set to a non-empty value if the script was queried through the HTTPS protocol.
Note: Note that when using ISAPI with IIS, the value will be off if the request was not made through the HTTPS protocol.
The text was updated successfully, but these errors were encountered:
While using this library with the drupal module i noticed that absolute images in the format
<img src="/myimage/image.png">
would not get translated to amp-img.The images do not have a width or height so it has to load the images to find these.
This part in the README looked much like my problem but did not seem to be the fix i needed as it did not work after following the tips.
When debugging i noticed the url used was http://myserver:443 which does not work as it expected htts://myserver.
The problem seems to be in this code
where
$_SERVER['https']
should be$_SERVER['HTTPS']
(this solved it for me)Also not sure if you want to support the edgecase noted in the PHP doc by checking for "off" as well
The text was updated successfully, but these errors were encountered: