openrat-cms

# OpenRat Content Management System
git clone http://git.code.weiherhei.de/openrat-cms.git
Log | Files | Refs

commit 3d8c42f40bfbeb6615da1e24edac8344e6aa761e
parent 09f61afca57993c57ada83c30a83566bb9ccaca5
Author: Jan Dankert <develop@jandankert.de>
Date:   Sat, 28 Mar 2020 00:53:17 +0100

Fix: Only set the maxlength if a maxlength is available.

Diffstat:
modules/cms/ui/themes/default/html/views/element/advanced.php | 8++++----
modules/cms/ui/themes/default/html/views/element/name.php | 2+-
modules/cms/ui/themes/default/html/views/element/properties.php | 8++++----
modules/cms/ui/themes/default/html/views/folder/createfile.php | 2+-
modules/cms/ui/themes/default/html/views/folder/createfolder.php | 2+-
modules/cms/ui/themes/default/html/views/folder/createimage.php | 2+-
modules/cms/ui/themes/default/html/views/folder/createlink.php | 2+-
modules/cms/ui/themes/default/html/views/folder/createpage.php | 2+-
modules/cms/ui/themes/default/html/views/folder/createtext.php | 2+-
modules/cms/ui/themes/default/html/views/folder/createurl.php | 2+-
modules/cms/ui/themes/default/html/views/page/form.php | 2+-
modules/cms/ui/themes/default/html/views/pageelement/value.php | 2+-
modules/template_engine/components/html/inputarea/Inputarea.class.php | 4+++-
13 files changed, 21 insertions(+), 19 deletions(-)

diff --git a/modules/cms/ui/themes/default/html/views/element/advanced.php b/modules/cms/ui/themes/default/html/views/element/advanced.php @@ -212,7 +212,7 @@ </span> </div> <div class="input"> - <textarea name="default_longtext" maxlength="0" class="inputarea"><?php echo encodeHtml(htmlentities(@$default_longtext)) ?> + <textarea name="default_longtext" class="inputarea"><?php echo encodeHtml(htmlentities(@$default_longtext)) ?> </textarea> </div> </div> @@ -224,7 +224,7 @@ </span> </div> <div class="input"> - <textarea name="parameters" maxlength="0" class="inputarea"><?php echo encodeHtml(htmlentities(@$parameters)) ?> + <textarea name="parameters" class="inputarea"><?php echo encodeHtml(htmlentities(@$parameters)) ?> </textarea> </div> </div> @@ -255,7 +255,7 @@ </span> </div> <div class="input"> - <textarea name="select_items" maxlength="0" class="inputarea"><?php echo encodeHtml(htmlentities(@$select_items)) ?> + <textarea name="select_items" class="inputarea"><?php echo encodeHtml(htmlentities(@$select_items)) ?> </textarea> </div> </div> @@ -333,7 +333,7 @@ </span> </div> <div class="input"> - <textarea name="code" maxlength="0" class="inputarea"><?php echo encodeHtml(htmlentities(@$code)) ?> + <textarea name="code" class="inputarea"><?php echo encodeHtml(htmlentities(@$code)) ?> </textarea> </div> </div> diff --git a/modules/cms/ui/themes/default/html/views/element/name.php b/modules/cms/ui/themes/default/html/views/element/name.php @@ -25,7 +25,7 @@ </span> </td> <td> - <textarea name="description" maxlength="0" class="inputarea"><?php echo encodeHtml(htmlentities(@$description)) ?> + <textarea name="description" class="inputarea"><?php echo encodeHtml(htmlentities(@$description)) ?> </textarea> </td> </tr> diff --git a/modules/cms/ui/themes/default/html/views/element/properties.php b/modules/cms/ui/themes/default/html/views/element/properties.php @@ -185,7 +185,7 @@ </span> </td> <td> - <textarea name="default_longtext" maxlength="0" class="inputarea"><?php echo encodeHtml(htmlentities(@$default_longtext)) ?> + <textarea name="default_longtext" class="inputarea"><?php echo encodeHtml(htmlentities(@$default_longtext)) ?> </textarea> </td> </tr> @@ -197,7 +197,7 @@ </span> </td> <td> - <textarea name="parameters" maxlength="0" class="inputarea"><?php echo encodeHtml(htmlentities(@$parameters)) ?> + <textarea name="parameters" class="inputarea"><?php echo encodeHtml(htmlentities(@$parameters)) ?> </textarea> </td> </tr> @@ -228,7 +228,7 @@ </span> </td> <td> - <textarea name="select_items" maxlength="0" class="inputarea"><?php echo encodeHtml(htmlentities(@$select_items)) ?> + <textarea name="select_items" class="inputarea"><?php echo encodeHtml(htmlentities(@$select_items)) ?> </textarea> </td> </tr> @@ -306,7 +306,7 @@ </span> </td> <td> - <textarea name="code" maxlength="0" class="inputarea"><?php echo encodeHtml(htmlentities(@$code)) ?> + <textarea name="code" class="inputarea"><?php echo encodeHtml(htmlentities(@$code)) ?> </textarea> </td> </tr> diff --git a/modules/cms/ui/themes/default/html/views/folder/createfile.php b/modules/cms/ui/themes/default/html/views/folder/createfile.php @@ -74,7 +74,7 @@ </span> </div> <div class="input"> - <textarea name="description" maxlength="0" class="inputarea"> + <textarea name="description" class="inputarea"> </textarea> </div> </div> diff --git a/modules/cms/ui/themes/default/html/views/folder/createfolder.php b/modules/cms/ui/themes/default/html/views/folder/createfolder.php @@ -25,7 +25,7 @@ </span> </div> <div class="input"> - <textarea name="description" maxlength="0" class="inputarea"> + <textarea name="description" class="inputarea"> </textarea> </div> </div> diff --git a/modules/cms/ui/themes/default/html/views/folder/createimage.php b/modules/cms/ui/themes/default/html/views/folder/createimage.php @@ -74,7 +74,7 @@ </span> </div> <div class="input"> - <textarea name="description" maxlength="0" class="inputarea"> + <textarea name="description" class="inputarea"> </textarea> </div> </div> diff --git a/modules/cms/ui/themes/default/html/views/folder/createlink.php b/modules/cms/ui/themes/default/html/views/folder/createlink.php @@ -29,7 +29,7 @@ </span> </div> <div class="input"> - <textarea name="description" maxlength="0" class="inputarea"> + <textarea name="description" class="inputarea"> </textarea> </div> </div> diff --git a/modules/cms/ui/themes/default/html/views/folder/createpage.php b/modules/cms/ui/themes/default/html/views/folder/createpage.php @@ -38,7 +38,7 @@ </span> </div> <div class="input"> - <textarea name="description" maxlength="0" class="inputarea"> + <textarea name="description" class="inputarea"> </textarea> </div> </div> diff --git a/modules/cms/ui/themes/default/html/views/folder/createtext.php b/modules/cms/ui/themes/default/html/views/folder/createtext.php @@ -73,7 +73,7 @@ </span> </div> <div class="input"> - <textarea name="description" maxlength="0" class="inputarea"> + <textarea name="description" class="inputarea"> </textarea> </div> </div> diff --git a/modules/cms/ui/themes/default/html/views/folder/createurl.php b/modules/cms/ui/themes/default/html/views/folder/createurl.php @@ -40,7 +40,7 @@ </span> </div> <div class="input"> - <textarea name="description" maxlength="0" class="inputarea"> + <textarea name="description" class="inputarea"> </textarea> </div> </div> diff --git a/modules/cms/ui/themes/default/html/views/page/form.php b/modules/cms/ui/themes/default/html/views/page/form.php @@ -57,7 +57,7 @@ </div> <?php } ?> <?php $if1=($type=='longtext'); if($if1) { ?> - <textarea name="<?php echo encodeHtml(htmlentities(@$id)) ?>" maxlength="0" class="inputarea"><?php echo encodeHtml(htmlentities(@$value)) ?> + <textarea name="<?php echo encodeHtml(htmlentities(@$id)) ?>" class="inputarea"><?php echo encodeHtml(htmlentities(@$value)) ?> </textarea> <?php } ?> <?php $if1=(in_array($type,explode(",",'select,link,list')); if($if1) { ?> diff --git a/modules/cms/ui/themes/default/html/views/pageelement/value.php b/modules/cms/ui/themes/default/html/views/pageelement/value.php @@ -185,7 +185,7 @@ </fieldset> <?php } ?> <?php $if1=($editor=='text'); if($if1) { ?> - <textarea name="text" maxlength="0" class="editor raw-editor"><?php echo encodeHtml(htmlentities(@$text)) ?> + <textarea name="text" class="editor raw-editor"><?php echo encodeHtml(htmlentities(@$text)) ?> </textarea> <?php } ?> diff --git a/modules/template_engine/components/html/inputarea/Inputarea.class.php b/modules/template_engine/components/html/inputarea/Inputarea.class.php @@ -40,7 +40,9 @@ class InputareaComponent extends FieldComponent $textarea->addAttribute('name',$this->name); if ( $this->readonly ) $textarea->addAttribute('disabled','disabled'); - $textarea->addAttribute('maxlength',$this->maxlength); + + if ( $this->maxlength ) + $textarea->addAttribute('maxlength',$this->maxlength); if ( $this->required ) $textarea->addAttribute( 'required','required');