From: ebullient Date: Sun, 28 Mar 2004 23:06:12 +0000 (+0000) Subject: Zap the soupNazi to use the same JS test everything else does. X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=7349fa120fb30fb895b9c78c5ae4e787733430be;p=squirrelmail.git Zap the soupNazi to use the same JS test everything else does. git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@6919 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- diff --git a/functions/plugin.php b/functions/plugin.php index 54c85e4f..7756b702 100644 --- a/functions/plugin.php +++ b/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 ***/