Squelching errors feels wrong, although in this case it's probably harmless.
authortassium <tassium@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Wed, 8 Jan 2003 14:49:59 +0000 (14:49 +0000)
committertassium <tassium@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Wed, 8 Jan 2003 14:49:59 +0000 (14:49 +0000)
Reworked timezone file code to be E_ALL clean without the use of @

git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@4400 7612ce4b-ef26-0410-bec9-ea0150e637f0

include/options/personal.php

index e0b7ad2..26b3793 100644 (file)
@@ -121,11 +121,13 @@ function load_optpage_data_personal() {
     if ( $tzChangeAllowed ) {
         $TZ_ARRAY[SMPREF_NONE] = _("Same as server");
         $tzfile = SM_PATH . 'locale/timezones.cfg';
-        if(!$fd = @fopen($tzfile ,'r')) {
-            $message = _("Error opening timezone config, contact administrator.");
-            plain_error_message($message, $color);
-            exit;
-        }
+               if ((!is_readable($tzfile)) or (!$fd = fopen($tzfile,'r'))) {
+               $message = _("Error opening timezone config, contact administrator.");
+               }
+               if (isset($message)) {
+                   plain_error_message($message, $color);
+                   exit;
+       }
         while (!feof ($fd)) {
             $zone = fgets($fd, 1024);
             if( $zone ) {