diff --git a/administrator/components/com_config/models/component.php b/administrator/components/com_config/models/component.php index db7f3d47eb861..c98eff3fefbac 100644 --- a/administrator/components/com_config/models/component.php +++ b/administrator/components/com_config/models/component.php @@ -17,6 +17,22 @@ */ class ConfigModelComponent extends JModelForm { + /** + * The event to trigger before saving the data. + * + * @var string + * @since 2.5.9 + */ + protected $event_before_save = 'onConfigurationBeforeSave'; + + /** + * The event to trigger before deleting the data. + * + * @var string + * @since 2.5.9 + */ + protected $event_after_save = 'onConfigurationAfterSave'; + /** * Method to auto-populate the model state. * @@ -108,7 +124,9 @@ function getComponent() */ public function save($data) { + $dispatcher = JDispatcher::getInstance(); $table = JTable::getInstance('extension'); + $isNew = true; // Save the rules. if (isset($data['params']) && isset($data['params']['rules'])) { @@ -154,6 +172,14 @@ public function save($data) return false; } + // Trigger the onContentBeforeSave event. + $result = $dispatcher->trigger($this->event_before_save, array($this->option . '.' . $this->name, $table, $isNew)); + if (in_array(false, $result, true)) + { + $this->setError($table->getError()); + return false; + } + // Store the data. if (!$table->store()) { $this->setError($table->getError()); @@ -163,6 +189,9 @@ public function save($data) // Clean the component cache. $this->cleanCache('_system'); + // Trigger the onContentAfterSave event. + $dispatcher->trigger($this->event_after_save, array($this->option . '.' . $this->name, $table, $isNew)); + return true; } } diff --git a/components/com_content/views/category/tmpl/blog_item.php b/components/com_content/views/category/tmpl/blog_item.php index 0d67f5ebbd834..57d1d5dda1225 100644 --- a/components/com_content/views/category/tmpl/blog_item.php +++ b/components/com_content/views/category/tmpl/blog_item.php @@ -146,7 +146,7 @@ $link1 = JRoute::_('index.php?option=com_users&view=login&Itemid=' . $itemId); $returnURL = JRoute::_(ContentHelperRoute::getArticleRoute($this->item->slug, $this->item->catid)); $link = new JURI($link1); - $link->setVar('return', base64_encode($returnURL)); + $link->setVar('return', base64_encode(urlencode($returnURL))); endif; ?>
diff --git a/components/com_content/views/category/tmpl/default_articles.php b/components/com_content/views/category/tmpl/default_articles.php index 89402f5233c69..52c9339e64ff4 100644 --- a/components/com_content/views/category/tmpl/default_articles.php +++ b/components/com_content/views/category/tmpl/default_articles.php @@ -157,7 +157,7 @@ $link = JRoute::_('index.php?option=com_users&view=login&Itemid='.$itemId); $returnURL = JRoute::_(ContentHelperRoute::getArticleRoute($article->slug)); $fullURL = new JURI($link); - $fullURL->setVar('return', base64_encode($returnURL)); + $fullURL->setVar('return', base64_encode((urlencode($returnURL)))); ?> diff --git a/components/com_content/views/featured/tmpl/default_item.php b/components/com_content/views/featured/tmpl/default_item.php index 6f0cf336723cb..a7d0875232a1c 100644 --- a/components/com_content/views/featured/tmpl/default_item.php +++ b/components/com_content/views/featured/tmpl/default_item.php @@ -146,7 +146,7 @@ $link1 = JRoute::_('index.php?option=com_users&view=login&Itemid=' . $itemId); $returnURL = JRoute::_(ContentHelperRoute::getArticleRoute($this->item->slug, $this->item->catid)); $link = new JURI($link1); - $link->setVar('return', base64_encode($returnURL)); + $link->setVar('return', base64_encode(urlencode($returnURL))); endif; ?>