Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions administrator/components/com_config/models/component.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down Expand Up @@ -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'])) {
Expand Down Expand Up @@ -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());
Expand All @@ -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;
}
}
2 changes: 1 addition & 1 deletion components/com_content/views/category/tmpl/blog_item.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
?>
<p class="readmore">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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))));
?>
<a href="<?php echo $fullURL; ?>" class="register">
<?php echo JText::_( 'COM_CONTENT_REGISTER_TO_READ_MORE' ); ?></a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
?>
<p class="readmore">
Expand Down