Bug in class-admin.php / function get_plugin_url()
-
Goedendag Rogier,
thank you very much for this outstanding plugin!
I found (and possibly fixed) the following bug:
File: class-admin.php
Function: get_plugin_url()
Lines: 1232 - 1239
$this->plugin_url returns a malformed URL like:
sub.example.comwp-content/plugins/really-simple-ssl/.In Multisite sub-sites this breaks the SSL in the Configuration tab and causes an extended delay until the request times out.
I found the use of home_url() instead of network_home_url() to be the main culprit. In addition, the final str_replace() appears to be mixed up.
The original code reads:
if (is_multisite() && ( !is_main_site(get_current_blog_id()) ) && (!$this->is_multisite_subfolder_install()) ) { $mainsiteurl = str_replace("https://","https://",network_site_url()); $home = str_replace("https://","https://",home_url()); $this->plugin_url = str_replace($mainsiteurl,home_url(), $this->plugin_url); //return http link if original url is http. if (strpos(home_url(), "https://")===FALSE) $this->plugin_url = str_replace("https://","https://",$this->plugin_url);
The proposed replacement code reads:
if (is_multisite() && ( !is_main_site(get_current_blog_id()) ) && (!$this->is_multisite_subfolder_install()) ) { $mainsiteurl = str_replace("https://","https://",network_site_url()); $home = str_replace("https://","https://",network_home_url()); $this->plugin_url = str_replace($mainsiteurl,network_home_url(), $this->plugin_url); //return http link if original url is http. if (strpos(network_home_url(), "https://")===FALSE) $this->plugin_url = str_replace("https://","https://",$this->plugin_url);
This at least works on my server. I wasn’t able to test out the last line of code in particular, because I have SSL configured to be always on, and I cannot turn it off easily.
Kind regards
- The topic ‘Bug in class-admin.php / function get_plugin_url()’ is closed to new replies.