aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--include/common.inc.php1
-rw-r--r--include/functions_url.inc.php2
-rw-r--r--include/php_compat/file_put_contents.php14
3 files changed, 16 insertions, 1 deletions
diff --git a/include/common.inc.php b/include/common.inc.php
index 7962bb791..5986fe087 100644
--- a/include/common.inc.php
+++ b/include/common.inc.php
@@ -125,6 +125,7 @@ foreach( array(
'array_intersect_key', //PHP 5 >= 5.1.0RC1
'hash_hmac', //(hash) - enabled by default as of PHP 5.1.2
'preg_last_error', // PHP 5 >= 5.2.0
+ 'file_put_contents', //PHP5
) as $func)
{
if (!function_exists($func))
diff --git a/include/functions_url.inc.php b/include/functions_url.inc.php
index 6180dae3e..00511e151 100644
--- a/include/functions_url.inc.php
+++ b/include/functions_url.inc.php
@@ -46,7 +46,7 @@ function get_root_url()
}
else
{
- return substr($root_url, 2);
+ return (string)substr($root_url, 2);
}
}
diff --git a/include/php_compat/file_put_contents.php b/include/php_compat/file_put_contents.php
new file mode 100644
index 000000000..679d9c984
--- /dev/null
+++ b/include/php_compat/file_put_contents.php
@@ -0,0 +1,14 @@
+<?php
+//php 5
+function file_put_contents($filename, $data)
+{
+ $fp = fopen($filename, 'w');
+ if ($fp)
+ {
+ $ret = fwrite($fp, $data);
+ fclose($fp);
+ return $ret;
+ }
+ return false;
+}
+?> \ No newline at end of file