Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CRM-17959 - allow URL to be redirected if the queue ID is invalid but… #7728

Merged
merged 1 commit into from
Jun 5, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions CRM/Mailing/Event/BAO/TrackableURLOpen.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,16 @@ public static function track($queue_id, $url_id) {
);

if (!$search->fetch()) {
// Whoops, error, don't track it. Return the base url.
// Can't find either the URL or the queue. If we can find the URL then
// return the URL without tracking. Otherwise return the base URL.

return CRM_Utils_System::baseURL();
$search->query("SELECT $turl.url as url from $turl
WHERE $turl.id = " . CRM_Utils_Type::escape($url_id, 'Integer')
);
if (!$search->fetch()) {
return CRM_Utils_System::baseURL();
}
return $search->url;
}

$open = new CRM_Mailing_Event_BAO_TrackableURLOpen();
Expand Down