More efficient way of checking script names.
authorMichael M Slusarz <slusarz@curecanti.org>
Fri, 12 Mar 2010 18:42:34 +0000 (11:42 -0700)
committerMichael M Slusarz <slusarz@curecanti.org>
Fri, 12 Mar 2010 19:28:16 +0000 (12:28 -0700)
imp/templates/javascript_defs_dimp.php

index ae9e6aa..c94aa84 100644 (file)
@@ -8,8 +8,6 @@
  * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
  */
 
-$compose_mode = (strstr($_SERVER['PHP_SELF'], 'compose-dimp.php') || strstr($_SERVER['PHP_SELF'], 'message-dimp.php'));
-
 $app_urls = $code = $flags = array();
 
 foreach (IMP_Dimp::menuList() as $app) {
@@ -149,7 +147,7 @@ $code['text'] = array(
     'vp_empty' => _("There are no messages in this mailbox."),
 );
 
-if ($compose_mode) {
+if (in_array(basename($_SERVER['PHP_SELF']), array('compose-dimp.php', 'message-dimp.php'))){
     $compose_cursor = $GLOBALS['prefs']->getValue('compose_cursor');
 
     /* Variables used in compose page. */