Skip to content

Check "is_ssl()" and change $uri#59

Open
tordans wants to merge 1 commit intothom4parisot:masterfrom
tordans:force_ssl
Open

Check "is_ssl()" and change $uri#59
tordans wants to merge 1 commit intothom4parisot:masterfrom
tordans:force_ssl

Conversation

@tordans
Copy link

@tordans tordans commented May 15, 2014

Our Server force SSL but WordPress does not understand it. So the
default URLs are not right. This change fixes this issue.

Our Server focus SSL but WordPress does not understand it. So the
default URLs are not right. This change fixes this issue.
@dboune
Copy link

dboune commented Jul 27, 2014

Noting that the modification in this PR is in vendored code managed elsewhere. I had a similar need to output https urls when using FORCE_ADMIN_SSL and so I made a similar change in the WPLessPlugin::processStylesheet function.

--- wp-content/plugins/wp-less.orig/lib/Plugin.class.php    Sun Jul 27 16:22:12 2014
+++ wp-content/plugins/wp-less/lib/Plugin.class.php Sun Jul 27 23:21:00 2014
@@ -196,7 +196,13 @@
             $this->compiler->cacheStylesheet($stylesheet, $force);
         }

-        $wp_styles->registered[$handle]->src = $stylesheet->getTargetUri();
+        $stylesheet_uri = $stylesheet->getTargetUri();
+
+        if (is_ssl()) {
+            $stylesheet_uri = preg_replace("/^http:/i", "https:", $stylesheet_uri);
+        }
+
+        $wp_styles->registered[$handle]->src = $stylesheet_uri;

         return $stylesheet;
     }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants