Skip to content

Commit

Permalink
Change all references from $dbo to $db
Browse files Browse the repository at this point in the history
I would like to point out, that the promoted CodeSniffer Rules discourage having variable names shorter than three characters.
  • Loading branch information
matrikular committed May 29, 2016
1 parent 9c20a24 commit b11e2d2
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions plugins/system/redirect/redirect.php
Expand Up @@ -130,31 +130,31 @@ private static function doErrorHandling($error)
JErrorPage::render($error);
}

$dbo = JFactory::getDbo();
$db = JFactory::getDbo();

$query = $dbo->getQuery(true);
$query = $db->getQuery(true);

$query->select('*')
->from($dbo->qn('#__redirect_links'))
->from($db->qn('#__redirect_links'))
->where(
'('
. $dbo->qn('old_url') . ' = ' . $dbo->q($url)
. $db->qn('old_url') . ' = ' . $db->q($url)
. ' OR '
. $dbo->qn('old_url') . ' = ' . $dbo->q($urlRel)
. $db->qn('old_url') . ' = ' . $db->q($urlRel)
. ' OR '
. $dbo->qn('old_url') . ' = ' . $dbo->q($urlWithoutQuery)
. $db->qn('old_url') . ' = ' . $db->q($urlWithoutQuery)
. ' OR '
. $dbo->qn('old_url') . ' = ' . $dbo->q($urlRelWithoutQuery)
. $db->qn('old_url') . ' = ' . $db->q($urlRelWithoutQuery)
. ')'
);

$dbo->setQuery($query);
$db->setQuery($query);

$redirect = null;

try
{
$redirects = $dbo->loadAssocList();
$redirects = $db->loadAssocList();

$possibleMatches = array_unique(
array($url, $urlRel, $urlWithoutQuery, $urlRelWithoutQuery)
Expand Down Expand Up @@ -222,7 +222,7 @@ private static function doErrorHandling($error)

try
{
$dbo->insertObject('#__redirect_links', $data, 'id');
$db->insertObject('#__redirect_links', $data, 'id');
}
catch (Exception $e)
{
Expand All @@ -237,7 +237,7 @@ private static function doErrorHandling($error)

try
{
$dbo->updateObject('#__redirect_links', $redirect, 'id');
$db->updateObject('#__redirect_links', $redirect, 'id');
}
catch (Exception $e)
{
Expand Down

0 comments on commit b11e2d2

Please sign in to comment.