protected function ShurlySubscriber::shurlyRedirectTo in ShURLy 8
1 call to ShurlySubscriber::shurlyRedirectTo()
File
- src/
ShurlySubscriber.php, line 49
Class
Namespace
Drupal\shurlyCode
protected function shurlyRedirectTo($row) {
\Drupal::moduleHandler()
->invokeAll('shurly_redirect_before', [
$row,
]);
$url = $row->destination;
$url = str_replace([
"\n",
"\r",
], '', $url);
session_write_close();
$response = new RedirectResponse($url);
$response
->send();
$request_time = \Drupal::time()
->getRequestTime();
\Drupal::database()
->query('UPDATE {shurly} SET count = count + 1, last_used = :time WHERE rid = :rid', [
'time' => $request_time,
'rid' => $row->rid,
]);
\Drupal::moduleHandler()
->invokeAll('shurly_redirect_after', [
$row,
]);
exit;
}