$url = $res->args['url'];
$url = Helper::addSchema($url);
$urlObj = new \Net_URL2($url);
$url = $urlObj->getNormalizedURL();
if (!Helper::isUrlAllowed($url)) {
$url = $res->args['url'];
$url = Helper::addSchema($url);
$urlObj = new \Net_URL2($url);
$url = $urlObj->getNormalizedURL();
if (!Helper::isUrlAllowed($url)) {
list($topic, $hub) = $subDb->detectHub($url);
if ($hub === null) {
Log::error('No hub URL found for topic');
list($topic, $hub) = $subDb->detectHub($url);
if ($hub === null) {
Log::error('No hub URL found for topic');
-if ($sub !== false) {
- Log::error('Topic exists already in subscription table');
- Log::info('Current status: ' . $sub->sub_status);
- exit(3);
+if ($sub === false) {
+ $subDb->create($topic);
+} else {
+ Log::info(
+ 'Topic exists already in subscription table with status '
+ . $sub->sub_status
+ );
+ Log::info('Renewing subscription...');
+ $subDb->renew($sub->sub_id);