From d7e203374954cc0674e01ef210a3179e7294597f Mon Sep 17 00:00:00 2001 From: Edoardo Vacchi Date: Wed, 20 Nov 2013 12:33:50 +0100 Subject: [PATCH 1/4] fix incorrect static id handling --- fp-includes/core/core.static.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/fp-includes/core/core.static.php b/fp-includes/core/core.static.php index cc50e41..6a6a769 100755 --- a/fp-includes/core/core.static.php +++ b/fp-includes/core/core.static.php @@ -24,15 +24,23 @@ } function static_parse($id) { + if (!static_isvalid($id)) return false; + if ($fname=static_exists($id)) { $entry = io_load_file($fname); return (utils_kexplode($entry)); } return array(); } + + function static_isvalid($id) { + return !preg_match('[^./\\\\]+'); + } function static_save($entry, $id, $oldid=null) { + if (!static_isvalid($id)) return false; + $fname = STATIC_DIR . $id . EXT; $entry['content'] = apply_filters('content_save_pre', $entry['content']); @@ -51,6 +59,8 @@ } function static_exists($id) { + if (!static_isvalid($id)) return false; + $fname = STATIC_DIR . $id . EXT; if (file_exists($fname)) @@ -60,6 +70,8 @@ } function static_delete($id) { + if (!static_isvalid($id)) return false; + return fs_delete(STATIC_DIR . $id . EXT); } From 9b5b77742d3ef70ce2902c503e06dc9f54b56cf3 Mon Sep 17 00:00:00 2001 From: Edoardo Vacchi Date: Wed, 20 Nov 2013 14:21:34 +0100 Subject: [PATCH 2/4] 1.0.1 version bump --- fp-includes/core/core.system.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fp-includes/core/core.system.php b/fp-includes/core/core.system.php index 0915908..b4deb58 100755 --- a/fp-includes/core/core.system.php +++ b/fp-includes/core/core.system.php @@ -73,7 +73,7 @@ - define('SYSTEM_VER', '1.0'); + define('SYSTEM_VER', '1.0.1'); function system_ver() { return 'fp-' . SYSTEM_VER; } From 5b99bfef255ac03c48edd049e55db869dcbb6908 Mon Sep 17 00:00:00 2001 From: Edoardo Vacchi Date: Tue, 26 Nov 2013 23:20:26 +0100 Subject: [PATCH 3/4] preg_match missing argument --- fp-includes/core/core.static.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fp-includes/core/core.static.php b/fp-includes/core/core.static.php index 6a6a769..4824963 100755 --- a/fp-includes/core/core.static.php +++ b/fp-includes/core/core.static.php @@ -34,7 +34,7 @@ } function static_isvalid($id) { - return !preg_match('[^./\\\\]+'); + return !preg_match('[^./\\\\]+', $id); } From b4368f07744a466c23e305cffbe7961bcb12a3ab Mon Sep 17 00:00:00 2001 From: Edoardo Vacchi Date: Wed, 27 Nov 2013 11:55:31 +0100 Subject: [PATCH 4/4] Update core.static.php --- fp-includes/core/core.static.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fp-includes/core/core.static.php b/fp-includes/core/core.static.php index 4824963..8e2a97e 100755 --- a/fp-includes/core/core.static.php +++ b/fp-includes/core/core.static.php @@ -34,7 +34,7 @@ } function static_isvalid($id) { - return !preg_match('[^./\\\\]+', $id); + return !preg_match('/[^./\\\\]+/', $id); }