commit 9c8b83ccb489a122c395b22e079d0a0143da49ff
parent 6c8869f83cf7cba92d57450f4cda914502bb7c9f
Author: Jan Dankert <develop@jandankert.de>
Date: Mon, 18 Nov 2019 22:39:02 +0100
Cleanup (and maybe a fix): Allow all UTF-8-encoded characters for text input.
Diffstat:
3 files changed, 6 insertions(+), 18 deletions(-)
diff --git a/modules/cms-core/action/Action.class.php b/modules/cms-core/action/Action.class.php
@@ -126,7 +126,7 @@ namespace cms\action {
* @param String $varName Schl�ssel
* @return String Inhalt
*/
- protected function getRequestVar($varName, $transcode = OR_FILTER_FULL)
+ protected function getRequestVar($varName, $transcode = OR_FILTER_TEXT)
{
return $this->request->getRequestVar($varName,$transcode);
}
diff --git a/modules/cms-core/action/ElementAction.class.php b/modules/cms-core/action/ElementAction.class.php
@@ -615,8 +615,8 @@ class ElementAction extends BaseAction
$this->element->typeid = $this->getRequestId('typeid');
$this->element->name = $this->getRequestVar('name' ,OR_FILTER_ALPHANUM);
- $this->element->label= $this->getRequestVar('label' ,OR_FILTER_ALL);
- $this->element->desc = $this->getRequestVar('description',OR_FILTER_ALL);
+ $this->element->label= $this->getRequestVar('label' ,OR_FILTER_TEXT);
+ $this->element->desc = $this->getRequestVar('description',OR_FILTER_TEXT);
$this->element->save();
diff --git a/modules/cms-core/action/RequestParams.class.php b/modules/cms-core/action/RequestParams.class.php
@@ -25,10 +25,8 @@ namespace {
define('OR_FILTER_FILENAME', 'file');
define('OR_FILTER_MAIL', 'mail');
define('OR_FILTER_TEXT', 'text');
- define('OR_FILTER_FULL', 'full');
define('OR_FILTER_NUMBER', '123');
define('OR_FILTER_RAW', 'raw');
- define('OR_FILTER_ALL', 'all');
}
@@ -64,7 +62,7 @@ namespace cms\action {
* @param String $varName Schl�ssel
* @return String Inhalt
*/
- public function getRequestVar($varName, $transcode = OR_FILTER_FULL)
+ public function getRequestVar($varName, $transcode = OR_FILTER_TEXT)
{
if($varName == REQ_PARAM_ID)
return $this->id;
@@ -103,18 +101,8 @@ namespace cms\action {
break;
case OR_FILTER_TEXT:
- case OR_FILTER_FULL:
- case OR_FILTER_ALL:
- // Ausfiltern von Control-Chars ( ASCII < 32 außer CR,LF) und HTML (<,>)
- $white = '';
- $white .= chr(10) . chr(13); // Line-Feed, Carriage-Return
- for ($i = 32; $i <= 59; $i++) $white .= chr($i); // Zahlen
- // 60: '<'
- $white .= chr(61);
- // 62: '>'
- for ($i = 63; $i <= 126; $i++) $white .= chr($i); // abc
- for ($i = 128; $i <= 255; $i++) $white .= chr($i); // Sonderzeichen incl. UTF-8, UTF-16 (beginnen mit Bit 1)
- break;
+ // Allow all UTF-8 characters.
+ return mb_convert_encoding($REQ[$varName], 'UTF-8', 'UTF-8');
case OR_FILTER_NUMBER:
$white = '1234567890.';