]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Might as well put a $limit on preg_replace here
authorMikael Nordfeldth <mmn@hethane.se>
Mon, 11 Jan 2016 17:26:44 +0000 (18:26 +0100)
committerMikael Nordfeldth <mmn@hethane.se>
Mon, 11 Jan 2016 17:27:26 +0000 (18:27 +0100)
Since there will (should) never be more than one ^http in that string anyway.

lib/action.php

index c2d60e11e974bec1414fe2b9b143b4babdb4ce0d..29dbbc618e60c30a103fc4812034d163083f4007 100644 (file)
@@ -1154,7 +1154,7 @@ class Action extends HTMLOutputter // lawsuit
                         $url = $sslimage;
                     } else if (preg_match('#^http://i.creativecommons.org/#', $image)) {
                         // CC support HTTPS on their images
-                        $url = preg_replace('/^http/', 'https', $image);
+                        $url = preg_replace('/^http/', 'https', $image, 1);
                     } else {
                         // Better to show mixed content than no content
                         $url = $image;