diff --git a/administrator/language/en-GB/en-GB.com_modules.ini b/administrator/language/en-GB/en-GB.com_modules.ini index ba4a412d21b5d..754289c998d4e 100644 --- a/administrator/language/en-GB/en-GB.com_modules.ini +++ b/administrator/language/en-GB/en-GB.com_modules.ini @@ -43,6 +43,7 @@ COM_MODULES_FIELD_CLIENT_ID_DESC="The location of the module, Frontend or Backen COM_MODULES_FIELD_CLIENT_ID_LABEL="Module Location" COM_MODULES_FIELD_CONTENT_DESC="Text" COM_MODULES_FIELD_CONTENT_LABEL="Text" +COM_MODULES_FIELD_CONTENT_TOO_LARGE="The content exceeds allowed limits" COM_MODULES_FIELD_MODULE_DESC="Module type." COM_MODULES_FIELD_MODULE_LABEL="Module Type" COM_MODULES_FIELD_MODULECLASS_SFX_DESC="A suffix to be applied to the CSS class of the module. This allows for individual module styling." diff --git a/libraries/src/Table/Module.php b/libraries/src/Table/Module.php index ee1f889cd41cf..078ac964151d1 100644 --- a/libraries/src/Table/Module.php +++ b/libraries/src/Table/Module.php @@ -123,6 +123,14 @@ public function check() return false; } + // Prevent to save too large content > 65535 + if ((strlen($this->content) > 65535) || (strlen($this->params) > 65535)) + { + $this->setError(\JText::_('COM_MODULES_FIELD_CONTENT_TOO_LARGE')); + + return false; + } + // Check the publish down date is not earlier than publish up. if ((int) $this->publish_down > 0 && $this->publish_down < $this->publish_up) {