Changeset:
        8a0653115c3d
        
https://sourceforge.net/p/mrbs/hg-code/ci/8a0653115c3de3a020d6d8c79e3c032c000282fd
Author:
        Campbell Morrison <[email protected]>
Date:
        Fri Sep 18 13:36:54 2015 +0100
Log message:

Fixed problem generating Warning on Help page on systems where exec() has been 
disabled

diffstat:

 web/functions.inc |   8 ++++++++
 web/version.inc   |  11 +++++++----
 2 files changed, 15 insertions(+), 4 deletions(-)

diffs (40 lines):

diff -r f0c0d29e6786 -r 8a0653115c3d web/functions.inc
--- a/web/functions.inc Fri Sep 18 12:51:35 2015 +0100
+++ b/web/functions.inc Fri Sep 18 13:36:54 2015 +0100
@@ -4,6 +4,14 @@
 
 require_once "mrbs_sql.inc";
 
+
+function function_disabled($name)
+{
+  $disabled = explode(', ', ini_get('disable_functions'));
+  return in_array($name, $disabled);
+}
+
+
 // Set the default timezone.   Caters for PHP servers that don't
 // have date_default_timezone_set()
 function mrbs_default_timezone_set($timezone)
diff -r f0c0d29e6786 -r 8a0653115c3d web/version.inc
--- a/web/version.inc   Fri Sep 18 12:51:35 2015 +0100
+++ b/web/version.inc   Fri Sep 18 13:36:54 2015 +0100
@@ -15,11 +15,14 @@
   // MRBS developers, make sure to update this string before each release
   $mrbs_version = "MRBS $mrbs_version_number";
 
-  $hg_id_out = exec("$hg_command id --id --branch", $output, $retval);
+  if (function_exists('exec') && !function_disabled('exec'))
+  {
+    $hg_id_out = exec("$hg_command id --id --branch", $output, $retval);
 
-  if (($retval == 0) && (strlen($hg_id_out)))
-  {
-    $mrbs_version .= "+hg ($hg_id_out)";
+    if (($retval == 0) && (strlen($hg_id_out)))
+    {
+      $mrbs_version .= "+hg ($hg_id_out)";
+    }
   }
 
   return $mrbs_version;

------------------------------------------------------------------------------
_______________________________________________
Mrbs-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mrbs-commits

Reply via email to