From fc6b63717c960766e1fdf80b701af9c733076902 Mon Sep 17 00:00:00 2001 From: Carsten Brandt Date: Sat, 4 Jan 2014 14:18:51 +0100 Subject: [PATCH] removed hard restriction of cache keyPrefix to alnum fixes #1773 --- extensions/yii/redis/Session.php | 4 ---- framework/yii/caching/Cache.php | 2 -- 2 files changed, 6 deletions(-) diff --git a/extensions/yii/redis/Session.php b/extensions/yii/redis/Session.php index 8f7a7e5..04e9074 100644 --- a/extensions/yii/redis/Session.php +++ b/extensions/yii/redis/Session.php @@ -68,8 +68,6 @@ class Session extends \yii\web\Session * it will use a prefix generated from [[Application::id]]. You may set this property to be an empty string * if you don't want to use key prefix. It is recommended that you explicitly set this property to some * static value if the cached data needs to be shared among multiple applications. - * - * To ensure interoperability, only alphanumeric characters should be used. */ public $keyPrefix; @@ -94,8 +92,6 @@ class Session extends \yii\web\Session } if ($this->keyPrefix === null) { $this->keyPrefix = substr(md5(Yii::$app->id), 0, 5); - } elseif (!ctype_alnum($this->keyPrefix)) { - throw new InvalidConfigException(get_class($this) . '::keyPrefix should only contain alphanumeric characters.'); } parent::init(); } diff --git a/framework/yii/caching/Cache.php b/framework/yii/caching/Cache.php index 31d1e2d..70f2585 100644 --- a/framework/yii/caching/Cache.php +++ b/framework/yii/caching/Cache.php @@ -82,8 +82,6 @@ abstract class Cache extends Component implements \ArrayAccess parent::init(); if ($this->keyPrefix === null) { $this->keyPrefix = substr(md5(Yii::$app->id), 0, 5); - } elseif (!ctype_alnum($this->keyPrefix)) { - throw new InvalidConfigException(get_class($this) . '::keyPrefix should only contain alphanumeric characters.'); } }