From 38bc438fc702eac6e5add125117280bd612611b2 Mon Sep 17 00:00:00 2001 From: the_undefined Date: Mon, 6 Oct 2008 10:43:57 +0000 Subject: [PATCH] Applying patch by rnowotniak, fixes #5523 git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@7706 3807eeeb-6ff5-0310-8944-8be069107fe0 --- cake/libs/validation.php | 2 +- cake/tests/cases/libs/validation.test.php | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/cake/libs/validation.php b/cake/libs/validation.php index 53d3aeeae..6ba051223 100644 --- a/cake/libs/validation.php +++ b/cake/libs/validation.php @@ -139,7 +139,7 @@ class Validation extends Object { if (empty($_this->check) && $_this->check != '0') { return false; } - $_this->regex = '/[^\s]+/mu'; + $_this->regex = '/[^\s]+/m'; return $_this->_check(); } /** diff --git a/cake/tests/cases/libs/validation.test.php b/cake/tests/cases/libs/validation.test.php index ccbb23865..0e948b93f 100644 --- a/cake/tests/cases/libs/validation.test.php +++ b/cake/tests/cases/libs/validation.test.php @@ -69,6 +69,20 @@ class ValidationTestCase extends CakeTestCase { function setup() { $this->Validation =& Validation::getInstance(); } +/** + * testNotEmpty method + * + * @access public + * @return void + */ + function testNotEmpty() { + $this->assertTrue(Validation::notEmpty('abcdefg')); + $this->assertTrue(Validation::notEmpty('fasdf ')); + $this->assertTrue(Validation::notEmpty('fooo'.chr(243).'blabla')); + + $this->assertFalse(Validation::notEmpty("\t ")); + $this->assertFalse(Validation::notEmpty("")); + } /** * testAlphaNumeric method *