http://atutor.ca/atutor/mantis/view.php?id=4574
[acontent.git] / docs / include / vitals.inc.php
index 83db8a2..2b422d2 100644 (file)
@@ -107,6 +107,9 @@ if (is_array($rows))
        }
 }
 
+//set the timezone, php 5.3+ problem. http://atutor.ca/atutor/mantis/view.php?id=4409
+date_default_timezone_set('UTC');
+
 // define as constants. more constants are defined in include/constants.inc.php
 define('EMAIL', $_config['contact_email']);
 define('SITE_NAME', $_config['site_name']);
@@ -397,4 +400,16 @@ function get_default_theme() {
                return $rows[0]['dir_name'];
 }
 
+/**
+ * Convert all '&' to '&' from the input
+ * @param   string  any string input, mainly URLs.
+ * @return  input with & replaced to '&'
+ * @author  Harris Wong
+ * @date    Oct 7, 2010
+ */
+function convertAmp($input){
+    $input = str_replace('&', '&', $input); //convert everything to '&' first
+    return str_replace('&', '&', $input);
+}
+
 ?>