Skip to content

Commit

Permalink
prepared sql
Browse files Browse the repository at this point in the history
  • Loading branch information
alikon committed Jul 3, 2019
1 parent f80eaba commit 047d1a8
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions administrator/components/com_redirect/Model/LinkModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,10 +168,12 @@ public function activate(&$pks, $url, $comment = null)
// Update the link rows.
$query = $db->getQuery(true)
->update($db->quoteName('#__redirect_links'))
->set($db->quoteName('new_url') . ' = ' . $db->quote($url))
->set($db->quoteName('new_url') . ' = :url')
->set($db->quoteName('published') . ' = ' . (int) 1)
->set($db->quoteName('comment') . ' = ' . $db->quote($comment))
->where($db->quoteName('id') . ' IN (' . implode(',', $pks) . ')');
->set($db->quoteName('comment') . ' = :comment')
->whereIn($db->quoteName('id'), $pks)
->bind(':url', $url)
->bind(':comment', $comment);
$db->setQuery($query);

try
Expand Down Expand Up @@ -225,10 +227,12 @@ public function duplicateUrls(&$pks, $url, $comment = null)
// Update the link rows.
$query = $db->getQuery(true)
->update($db->quoteName('#__redirect_links'))
->set($db->quoteName('new_url') . ' = ' . $db->quote($url))
->set($db->quoteName('modified_date') . ' = ' . $db->quote($date))
->set($db->quoteName('new_url') . ' = :url')
->set($db->quoteName('modified_date') . ' = :date')
->set($db->quoteName('published') . ' = ' . 1)
->where($db->quoteName('id') . ' IN (' . implode(',', $pks) . ')');
->whereIn($db->quoteName('id'), $pks)
->bind(':url', $url)
->bind(':date', $date);

if (!empty($comment))
{
Expand Down

0 comments on commit 047d1a8

Please sign in to comment.