Skip to content
This repository was archived by the owner on Jan 8, 2020. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions library/Zend/Filter/Alnum.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,15 @@ class Alnum extends AbstractFilter
* @param boolean $allowWhiteSpace
* @return void
*/
public function __construct($options = null)
public function __construct($options = false)
{
if ($options instanceof Config) {
$options = $options->toArray();
} elseif (!is_array($options)) {
$options = func_get_args();
$temp = array();
if (!empty($options)) {
$temp['allowwhitespace'] = array_shift($options);
$temp['allowWhiteSpace'] = array_shift($options);
}

if (!empty($options)) {
Expand All @@ -86,8 +86,8 @@ public function __construct($options = null)
self::$unicodeEnabled = (@preg_match('/\pL/u', 'a')) ? true : false;
}

if (array_key_exists('allowwhitespace', $options)) {
$this->setAllowWhiteSpace($options['allowwhitespace']);
if (array_key_exists('allowWhiteSpace', $options)) {
$this->setAllowWhiteSpace($options['allowWhiteSpace']);
}

if (!array_key_exists('locale', $options)) {
Expand Down Expand Up @@ -156,14 +156,14 @@ public function filter($value)
if (!self::$unicodeEnabled) {
// POSIX named classes are not supported, use alternative a-zA-Z0-9 match
$pattern = '/[^a-zA-Z0-9' . $whiteSpace . ']/';
} elseif (((string) $this->locale == 'ja')
|| ((string) $this->locale == 'ko')
} elseif (((string) $this->locale == 'ja')
|| ((string) $this->locale == 'ko')
|| ((string) $this->locale == 'zh')
) {
// The Alphabet means english alphabet.
// Use english alphabeth
$pattern = '/[^a-zA-Z0-9' . $whiteSpace . ']/u';
} else {
// The Alphabet means each language's alphabet.
// Use native language alphabeth
$pattern = '/[^\p{L}\p{N}' . $whiteSpace . ']/u';
}

Expand Down
14 changes: 7 additions & 7 deletions library/Zend/Filter/Alpha.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public function __construct($options = false)
$options = func_get_args();
$temp = array();
if (!empty($options)) {
$temp['allowwhitespace'] = array_shift($options);
$temp['allowWhiteSpace'] = array_shift($options);
}

if (!empty($options)) {
Expand All @@ -86,8 +86,8 @@ public function __construct($options = false)
self::$unicodeEnabled = (@preg_match('/\pL/u', 'a')) ? true : false;
}

if (array_key_exists('allowwhitespace', $options)) {
$this->setAllowWhiteSpace($options['allowwhitespace']);
if (array_key_exists('allowWhiteSpace', $options)) {
$this->setAllowWhiteSpace($options['allowWhiteSpace']);
}

if (!array_key_exists('locale', $options)) {
Expand Down Expand Up @@ -156,14 +156,14 @@ public function filter($value)
if (!self::$unicodeEnabled) {
// POSIX named classes are not supported, use alternative a-zA-Z match
$pattern = '/[^a-zA-Z' . $whiteSpace . ']/';
} elseif (((string) $this->locale == 'ja')
|| ((string) $this->locale == 'ko')
} elseif (((string) $this->locale == 'ja')
|| ((string) $this->locale == 'ko')
|| ((string) $this->locale == 'zh')
) {
// The Alphabet means english alphabet.
// Use english alphabeth
$pattern = '/[^a-zA-Z' . $whiteSpace . ']/u';
} else {
// The Alphabet means each language's alphabet.
// Use native language alphabeth
$pattern = '/[^\p{L}' . $whiteSpace . ']/u';
}

Expand Down
5 changes: 4 additions & 1 deletion library/Zend/Http/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -710,9 +710,10 @@ protected function calcAuthDigest($user, $password, $type = self::AUTH_BASIC, $d
}
return $response;
}

/**
* Reset all the HTTP parameters (auth,cookies,request, response, etc)
*
* @return Client
*/
public function resetParameters()
{
Expand All @@ -726,6 +727,8 @@ public function resetParameters()
$this->response = null;

$this->setUri($uri);

return $this;
}

/**
Expand Down
6 changes: 3 additions & 3 deletions tests/Zend/Filter/AlnumTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
namespace ZendTest\Filter;

use Zend\Filter\Alnum as AlnumFilter,
Zend\Locale\Locale,
Zend\Locale\Locale as ZendLocale,
Zend\Registry;

/**
Expand Down Expand Up @@ -75,7 +75,7 @@ public function setUp()
self::$_unicodeEnabled = (@preg_match('/\pL/u', 'a')) ? true : false;
}
if (null === self::$_meansEnglishAlphabet) {
$this->_locale = new Locale('auto');
$this->_locale = new ZendLocale('auto');
self::$_meansEnglishAlphabet = in_array($this->_locale->getLanguage(),
array('ja')
);
Expand Down Expand Up @@ -189,7 +189,7 @@ public function testAllowWhiteSpace()
*/
public function testRegistryLocale()
{
$locale = new Locale('ja');
$locale = new ZendLocale('ja');
\Zend\Registry::set('Zend_Locale', $locale);

if (!self::$_unicodeEnabled) {
Expand Down