Jelajahi Sumber

Zap the soupNazi to use the same JS test everything else does.

Erin Schnabel 21 tahun lalu
induk
melakukan
027240f167
1 mengubah file dengan 3 tambahan dan 10 penghapusan
  1. 3 10
      functions/plugin.php

+ 3 - 10
functions/plugin.php

@@ -16,6 +16,7 @@
 
 /** Everything needs global.. */
 require_once(SM_PATH . 'functions/global.php');
+require_once(SM_PATH . 'functions/prefs.php');
 
 global $squirrelmail_plugin_hooks;
 $squirrelmail_plugin_hooks = array();
@@ -169,21 +170,13 @@ function boolean_hook_function($name,$parm=NULL,$priority=0,$tie=false) {
  * This function checks whether the user's USER_AGENT is known to
  * be broken. If so, returns true and the plugin is invisible to the
  * offending browser.
+ * *** THIS IS A TEST FOR JAVASCRIPT SUPPORT ***
  * This function needs to have its name changed!
  *
  * @return bool whether this browser properly supports JavaScript
  */
 function soupNazi(){
-
-    $soup_menu = array('Mozilla/3','Mozilla/2','Mozilla/1', 'Opera 4',
-                       'Opera/4', 'OmniWeb', 'Lynx');
-    sqgetGlobalVar('HTTP_USER_AGENT', $user_agent, SQ_SERVER);
-    foreach($soup_menu as $browser) {
-        if(stristr($user_agent, $browser)) {
-            return 1;
-        }
-    }
-    return 0;
+    return !checkForJavascript();
 }
 /*************************************/
 /*** MAIN PLUGIN LOADING CODE HERE ***/