summaryrefslogtreecommitdiff
path: root/inc/io.php
diff options
context:
space:
mode:
Diffstat (limited to 'inc/io.php')
-rw-r--r--inc/io.php5
1 files changed, 5 insertions, 0 deletions
diff --git a/inc/io.php b/inc/io.php
index 4c7fb094f..6d3c20047 100644
--- a/inc/io.php
+++ b/inc/io.php
@@ -298,6 +298,11 @@ function io_saveFile($file, $content, $append=false) {
* @return bool true on success
*/
function io_replaceInFile($file, $oldline, $newline, $regex=false, $maxlines=0) {
+ if ((string)$oldline === '') {
+ trigger_error('$oldline parameter cannot be empty in io_replaceInFile()', E_USER_WARNING);
+ return false;
+ }
+
if (!file_exists($file)) return true;
io_lock($file);