Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
alikon committed Jul 4, 2019
1 parent 6c4abdb commit 68cc7e9
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions administrator/components/com_redirect/Model/LinksModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -227,9 +227,7 @@ public function batchProcess($batch_urls)
$db->quoteName('created_date')
];

$i = 0;

foreach ($batch_urls as $batch_url)
foreach ($batch_urls as $i => $batch_url)
{
$old_url = $batch_url[0];

Expand All @@ -244,27 +242,26 @@ public function batchProcess($batch_urls)
}

$values = [
':oldurl' . $i,
':newurl' . $i,
'',
'',
0,
':state' . $i,
':created' . $i,
':oldurl' . $i,
':newurl' . $i,
$db->quote(''),
$db->quote(''),
0,
':state' . $i,
':created' . $i,
];

$query->clear()
->insert($db->quoteName('#__redirect_links'), false)
->columns($columns)
->values($values)
->values(implode(', ', $values))
->bind(':oldurl' . $i, $old_url)
->bind(':newurl' . $i, $new_url)
->bind(':state' . $i, $state, ParameterType::INTEGER)
->bind(':created' . $i, $created);

$db->setQuery($query);
$db->execute();
$i++;
}

return true;
Expand Down

0 comments on commit 68cc7e9

Please sign in to comment.