Changeset:
        0464bab6319a
        
https://sourceforge.net/p/mrbs/hg-code/ci/0464bab6319a1740175905d455392c8ae74b2ff8
Author:
        Campbell Morrison <[email protected]>
Date:
        Tue Mar 01 09:42:00 2016 +0000
Log message:

Replaced calls to file_exists() with is_readable() to cover the theoretical 
case when a file exists but doesn't have read permissions.

diffstat:

 web/edit_area_room.php |  2 +-
 web/functions.inc      |  4 ++--
 web/functions_ical.inc |  4 ++--
 web/functions_mail.inc |  2 +-
 web/js.inc             |  4 ++--
 web/language.inc       |  8 ++++----
 web/lib/autoload.inc   |  2 +-
 web/upgrade.inc        |  2 +-
 8 files changed, 14 insertions(+), 14 deletions(-)

diffs (145 lines):

diff -r 98f9944c95b2 -r 0464bab6319a web/edit_area_room.php
--- a/web/edit_area_room.php    Tue Mar 01 09:24:35 2016 +0000
+++ b/web/edit_area_room.php    Tue Mar 01 09:42:00 2016 +0000
@@ -98,7 +98,7 @@
       $tz_dir = ($zoneinfo_outlook_compatible) ? TZDIR_OUTLOOK : TZDIR;  
       $tz_file = "$tz_dir/$value.ics";
       // UTC is a special case because we can always produce UTC times in 
iCalendar
-      if (($city=='UTC') || file_exists($tz_file))
+      if (($city=='UTC') || is_readable($tz_file))
       {
         $timezones[$continent][] = $city;
       }
diff -r 98f9944c95b2 -r 0464bab6319a web/functions.inc
--- a/web/functions.inc Tue Mar 01 09:24:35 2016 +0000
+++ b/web/functions.inc Tue Mar 01 09:42:00 2016 +0000
@@ -157,7 +157,7 @@
   
   // Load the print_theme_header function appropriate to the theme.    If there
   // isn't one then fall back to the default header.
-  if (file_exists("Themes/$theme/header.inc"))
+  if (is_readable("Themes/$theme/header.inc"))
   {
     include_once "Themes/$theme/header.inc";
   }
@@ -177,7 +177,7 @@
 function print_footer($and_exit)
 {
   global $theme;
-  if (file_exists("Themes/$theme/footer.inc"))
+  if (is_readable("Themes/$theme/footer.inc"))
   {
     include_once "Themes/$theme/footer.inc";
   }
diff -r 98f9944c95b2 -r 0464bab6319a web/functions_ical.inc
--- a/web/functions_ical.inc    Tue Mar 01 09:24:35 2016 +0000
+++ b/web/functions_ical.inc    Tue Mar 01 09:42:00 2016 +0000
@@ -187,7 +187,7 @@
   }
   // There's nothing in the database, so try and get a VTIMEZONE component
   // from the filesystem.
-  elseif (file_exists($tz_file))
+  elseif (is_readable($tz_file))
   {
     $vcalendar = file_get_contents($tz_file);
     
@@ -961,7 +961,7 @@
           switch ($key)
           {
             case 'to':
-              $role = "REQ-PARTICIPANT";
+              $role = "REQ-PARTICIPANT;RSVP=TRUE";
               break;
             default:
               if (in_array($attendee, $attendees['to']))
diff -r 98f9944c95b2 -r 0464bab6319a web/functions_mail.inc
--- a/web/functions_mail.inc    Tue Mar 01 09:24:35 2016 +0000
+++ b/web/functions_mail.inc    Tue Mar 01 09:42:00 2016 +0000
@@ -403,7 +403,7 @@
     $body .= "<title></title>\n";
     $body .= "<style type=\"text/css\">\n";
     $css_file = 'css/mrbs-mail.css';
-    if (file_exists($css_file))
+    if (is_readable($css_file))
     {
       $fh = fopen($css_file, 'r');
       $css = fread($fh, filesize($css_file));
diff -r 98f9944c95b2 -r 0464bab6319a web/js.inc
--- a/web/js.inc        Tue Mar 01 09:24:35 2016 +0000
+++ b/web/js.inc        Tue Mar 01 09:42:00 2016 +0000
@@ -173,13 +173,13 @@
     
     
 // Get any page specific JavaScript
-if (file_exists("js/$page.js"))
+if (is_readable("js/$page.js"))
 {
   ?>
   <script type="text/javascript" src="js/<?php echo $page?>.js"></script>
   <?php
 }
-if (file_exists("js/$page.js.php"))
+if (is_readable("js/$page.js.php"))
 {
   ?>
   <script type="text/javascript" src="js/<?php echo $page?>.js.php?<?php echo 
$standard_query_string ?>"></script>
diff -r 98f9944c95b2 -r 0464bab6319a web/language.inc
--- a/web/language.inc  Tue Mar 01 09:24:35 2016 +0000
+++ b/web/language.inc  Tue Mar 01 09:42:00 2016 +0000
@@ -956,7 +956,7 @@
 {
   global $default_language_tokens;
   
-  if (!file_exists($dir))
+  if (!is_dir($dir))
   {
     trigger_error("MRBS: directory $dir does not exist", E_USER_NOTICE);
     return NULL;
@@ -1073,7 +1073,7 @@
   
   $lang = utf8_strtolower($lang);
 
-  if (file_exists('lang'))
+  if (is_readable('lang'))
   {
     $lang_file = "lang/lang.$lang";
   }
@@ -1084,12 +1084,12 @@
     $lang_file = "../lang/lang.$lang";
   }
   // When in CLI mode, we need to add the full path name as
-  // file_exists() ignores the include path
+  // is_readable() ignores the include path
   if ($cli_mode)
   {
     $lang_file = dirname($PHP_SELF) . "/" . $lang_file;
   }
-  if (file_exists($lang_file))
+  if (is_readable($lang_file))
   {
     // Get the standard language tokens
     include "$lang_file";
diff -r 98f9944c95b2 -r 0464bab6319a web/lib/autoload.inc
--- a/web/lib/autoload.inc      Tue Mar 01 09:24:35 2016 +0000
+++ b/web/lib/autoload.inc      Tue Mar 01 09:42:00 2016 +0000
@@ -10,7 +10,7 @@
   // Append '.php'
   $file = $base_dir . str_replace('\\', '/', $class) . '.php';
   
-  if (file_exists($file))
+  if (is_readable($file))
   {
     require $file;
   }
diff -r 98f9944c95b2 -r 0464bab6319a web/upgrade.inc
--- a/web/upgrade.inc   Tue Mar 01 09:24:35 2016 +0000
+++ b/web/upgrade.inc   Tue Mar 01 09:42:00 2016 +0000
@@ -104,7 +104,7 @@
     upgrade_echo("</p>\n");
     
     // Now execute the PHP file if there is one
-    if (file_exists($php_filename))
+    if (is_readable($php_filename))
     {
       include($php_filename);
     }

------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
_______________________________________________
Mrbs-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mrbs-commits

Reply via email to