Skip to content

Commit

Permalink
Atualização para joomla 3.4.8
Browse files Browse the repository at this point in the history
  • Loading branch information
berlanda committed Dec 27, 2015
1 parent 3aca1f3 commit cb2d2e6
Show file tree
Hide file tree
Showing 11 changed files with 281 additions and 49 deletions.
56 changes: 56 additions & 0 deletions administrator/components/com_admin/script.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ public function update($installer)
$this->updateDatabase();
$this->clearRadCache();
$this->updateAssets();

// VERY IMPORTANT! THIS METHOD SHOULD BE CALLED LAST, SINCE IT COULD
// LOGOUT ALL THE USERS
$this->flushSessions();
}

/**
Expand Down Expand Up @@ -1478,4 +1482,56 @@ public function updateAssets()

return true;
}

/**
* If we migrated the session from the previous system, flush all the active sessions.
* Otherwise users will be logged in, but not able to do anything since they don't have
* a valid session
*
* @return boolean
*/
public function flushSessions()
{
/**
* The session may have not been started yet (e.g. CLI-based Joomla! update scripts). Let's make sure we do
* have a valid session.
*/
JFactory::getSession()->restart();

// If $_SESSION['__default'] is no longer set we do not have a migrated session, therefore we can quit.
if (!isset($_SESSION['__default']))
{
return true;
}

$db = JFactory::getDbo();

try
{
switch ($db->name)
{
// MySQL database, use TRUNCATE (faster, more resilient)
case 'pdomysql':
case 'mysql':
case 'mysqli':
$db->truncateTable($db->qn('#__sessions'));
break;

// Non-MySQL databases, use a simple DELETE FROM query
default:
$query = $db->getQuery(true)
->delete($db->qn('#__sessions'));
$db->setQuery($query)->execute();
break;
}
}
catch (Exception $e)
{
echo JText::sprintf('JLIB_DATABASE_ERROR_FUNCTION_FAILED', $e->getCode(), $e->getMessage()) . '<br />';

return false;
}

return true;
}
}
7 changes: 5 additions & 2 deletions administrator/components/com_categories/models/category.php
Original file line number Diff line number Diff line change
Expand Up @@ -575,9 +575,12 @@ public function save($data)
// Adding self to the association
$associations = $data['associations'];

// Unset any invalid associations
$associations = Joomla\Utilities\ArrayHelper::toInteger($associations);

foreach ($associations as $tag => $id)
{
if (empty($id))
if (!$id)
{
unset($associations[$tag]);
}
Expand Down Expand Up @@ -618,7 +621,7 @@ public function save($data)

foreach ($associations as $id)
{
$query->values($id . ',' . $db->quote($this->associationsContext) . ',' . $db->quote($key));
$query->values(((int) $id) . ',' . $db->quote($this->associationsContext) . ',' . $db->quote($key));
}

$db->setQuery($query);
Expand Down
7 changes: 5 additions & 2 deletions administrator/components/com_menus/models/item.php
Original file line number Diff line number Diff line change
Expand Up @@ -1284,9 +1284,12 @@ public function save($data)
// Adding self to the association
$associations = $data['associations'];

// Unset any invalid associations
$associations = Joomla\Utilities\ArrayHelper::toInteger($associations);

foreach ($associations as $tag => $id)
{
if (empty($id))
if (!$id)
{
unset($associations[$tag]);
}
Expand Down Expand Up @@ -1330,7 +1333,7 @@ public function save($data)

foreach ($associations as $id)
{
$query->values($id . ',' . $db->quote($this->associationsContext) . ',' . $db->quote($key));
$query->values(((int) $id) . ',' . $db->quote($this->associationsContext) . ',' . $db->quote($key));
}

$db->setQuery($query);
Expand Down
1 change: 0 additions & 1 deletion administrator/components/com_templates/models/template.php
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,6 @@ public function &getSource()
$fileName = base64_decode($input->get('file'));
$client = JApplicationHelper::getClientInfo($this->template->client_id);


try
{
$filePath = JPath::check($client->path . '/templates/' . $this->template->element . '/' . $fileName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ function clearCoords()
<input type="hidden" name="task" value="template.delete" />
<input type="hidden" name="id" value="<? echo $input->getInt('id'); ?>" />
<input type="hidden" name="file" value="<? echo $this->file; ?>" />
<?php echo JHtml::_( 'form.token' ); ?>
<?php echo JHtml::_('form.token'); ?>
<a href="#" class="btn" data-dismiss="modal"><?php echo JText::_('COM_TEMPLATES_TEMPLATE_CLOSE'); ?></a>
<button type="submit" class="btn btn-danger"><?php echo JText::_('COM_TEMPLATES_BUTTON_DELETE');?></button>
</form>
Expand Down
2 changes: 1 addition & 1 deletion administrator/manifests/files/joomla.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<authorUrl>www.joomla.org</authorUrl>
<copyright>(C) 2005 - 2015 Open Source Matters. All rights reserved</copyright>
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>
<version>3.4.6</version>
<version>3.4.8</version>
<creationDate>December 2015</creationDate>
<description>FILES_JOOMLA_XML_DESCRIPTION</description>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ function clearCoords()
<input type="hidden" name="task" value="template.delete" />
<input type="hidden" name="id" value="<? echo $input->getInt('id'); ?>" />
<input type="hidden" name="file" value="<? echo $this->file; ?>" />
<?php echo JHtml::_( 'form.token' ); ?>
<?php echo JHtml::_('form.token'); ?>
<a href="#" class="btn" data-dismiss="modal"><?php echo JText::_('COM_TEMPLATES_TEMPLATE_CLOSE'); ?></a>
<button type="submit"><?php echo JText::_('COM_TEMPLATES_BUTTON_DELETE');?></button>
</form>
Expand Down
6 changes: 3 additions & 3 deletions libraries/cms/version/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ final class JVersion
public $RELEASE = '3.4';

/** @var string Maintenance version. */
public $DEV_LEVEL = '6';
public $DEV_LEVEL = '8';

/** @var string Development STATUS. */
public $DEV_STATUS = 'Stable';
Expand All @@ -35,10 +35,10 @@ final class JVersion
public $CODENAME = 'Ember';

/** @var string Release date. */
public $RELDATE = '15-December-2015';
public $RELDATE = '24-December-2015';

/** @var string Release time. */
public $RELTIME = '11:11';
public $RELTIME = '19:30';

/** @var string Release timezone. */
public $RELTZ = 'GMT';
Expand Down
2 changes: 1 addition & 1 deletion libraries/joomla/database/driver/mysqli.php
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ public function connect()
public function disconnect()
{
// Close the connection.
if ($this->connection)
if ($this->connection instanceof mysqli && $this->connection->stat() !== false)
{
foreach ($this->disconnectHandlers as $h)
{
Expand Down
Loading

0 comments on commit cb2d2e6

Please sign in to comment.