From c9edb943f99704a649612afa6ae7825b2e6bc44e Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sat, 10 Apr 2010 17:01:48 -0700 Subject: [PATCH] Fix a bug introduced when we patched the "disallowed global data" security check. Not sure why the patch worked for some and not for others, but this should resolve it either way. Fixes ticket #1123. --- modules/gallery/libraries/MY_Input.php | 2 +- modules/gallery/tests/Input_Library_Test.php | 25 ++++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 modules/gallery/tests/Input_Library_Test.php diff --git a/modules/gallery/libraries/MY_Input.php b/modules/gallery/libraries/MY_Input.php index 703136c70d..1d5949e870 100644 --- a/modules/gallery/libraries/MY_Input.php +++ b/modules/gallery/libraries/MY_Input.php @@ -26,6 +26,6 @@ class Input extends Input_Core { * @return string */ public function clean_input_keys($str) { - return preg_replace('#^[\pL0-9:_.-]++$#uD', '_', $str); + return preg_replace('#[^a-zA-Z0-9:_.-]+#', '_', $str); } } diff --git a/modules/gallery/tests/Input_Library_Test.php b/modules/gallery/tests/Input_Library_Test.php new file mode 100644 index 0000000000..0664132396 --- /dev/null +++ b/modules/gallery/tests/Input_Library_Test.php @@ -0,0 +1,25 @@ +assert_same("foo_bar", $input->clean_input_keys("foo|bar")); + } +} \ No newline at end of file