WPG2 should use SSL in wp-admin when appropriate

mystyman

Joined: 2008-08-27
Posts: 1
Posted: Wed, 2008-08-27 07:52

WPG2 loads some javascript in the wp-admin section of wordpress. This should use https if the wp-admin is using SSL, as is possible in wordpress 2.6+, because otherwise the browser may spit out warnings about "part of the page is going over insecure connection" etc, and show a broken security lock icon in the corner.

Here's included a patch that seems to remidy this.

--- wpg2functions.inc   (revision 61809)
+++ wpg2functions.inc   (working copy)
@@ -505,6 +505,9 @@

        if ( strstr( $_SERVER['PHP_SELF'], "admin.php")) {
                $wpg2help = get_bloginfo('wpurl').'/wp-content/plugins/wpg2/js/helpwindow.js';
+               if ( function_exists('is_ssl') && is_ssl() ) {
+                       $wpg2help = preg_replace('|^http://|', 'https://', $wpg2help);
+               }
                echo '<script type="text/javascript" src="'.$wpg2help.'"></script>';
        }
 }

Do you guys have a project TRACker type thing where i should post patches?

Also I have attached this patch.

AttachmentSize
use_ssl_for_adminjsheader_if_is_ssl_patch.txt536 bytes
 
ozgreg
ozgreg's picture

Joined: 2003-10-18
Posts: 1378
Posted: Thu, 2008-08-28 00:51

We have a Mantis bug tracking page however I cannot do a lot of development right now as my dev machine is borked :(

____________________________________
Wordpress / Gallery2 (WPG2) Plugin, , WPG2 Documentation, WPG2 Demo