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.
On line 460 of sharethis.module it checks for $_SERVER['HTTPS'] == 'on' to determine whether to use the secure Javascript include or not. The site I'm working on has ON as uppercase however, so this check fails.
I suggest a simple strtolower() before the check for it to work in both eventualities.
if (isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on') {
Comment | File | Size | Author |
---|---|---|---|
#3 | sharethis-check_for_HTTPS_fails-1942126-3.patch | 590 bytes | Gaofengzzz |
Comments
Comment #1
jlockhartWorked for me, site reports all secure now.
Comment #2
AL the X CreditAttribution: AL the X commentedBetter would be to include the Javascript _without_ the protocol, e.g.
<script src="//example.com/path/to/library.js"></script>
, which bypasses the problem of checking (or normalizing) the$_SERVER["HTTPS"]
value.Comment #3
Gaofengzzz CreditAttribution: Gaofengzzz commented@AL the X, thank you for your idea. But it is not work in my side.
I have created a patch as @Gwellin's code.
Comment #4
Gaofengzzz CreditAttribution: Gaofengzzz commentedThis patch has been commited. See 2349f54. Thank you