Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Topic started by: Sir Osis of Liver on November 23, 2020, 08:34:02 PM

Title: Incorrect url in topic notifications
Post by: Sir Osis of Liver on November 23, 2020, 08:34:02 PM
Topic notifications look like this -

A reply has been posted to a topic you are watching by TKO™. View the reply at: http://kotct2017.knightsofthecoointable.com/index.php?topic=5941.new;topicseen#new Unsubscribe to this topic by using this link: http://kotct2017.knightsofthecointable.com/index.php?action=notify;topic=5941.0 More replies may be posted, but you won't receive any more notifications until you

Unsubscribe link is correct and works, topic link url is incorrect and doesnt work.  It has an extra 'o' - knightsofthecoointable.com.  Any idea what causes this?
Title: Re: Incorrect url in topic notifications
Post by: Kindred on November 23, 2020, 08:47:43 PM
Did someone hard code part of the link into the message?
Title: Re: Incorrect url in topic notifications
Post by: Sir Osis of Liver on November 23, 2020, 08:53:25 PM
No, they wouldn't know how to do that.  Where does the script get the url?
Title: Re: Incorrect url in topic notifications
Post by: Sir Osis of Liver on November 23, 2020, 10:31:02 PM
Looks like it's here -

Subs-Post.php



$replacements = array(
'TOPICSUBJECT' => $topicData[$row['id_topic']]['subject'],
'POSTERNAME' => un_htmlspecialchars($topicData[$row['id_topic']]['name']),
'TOPICLINK' => $scripturl . '?topic=' . $row['id_topic'] . '.new;topicseen#new',
'UNSUBSCRIBELINK' => $scripturl . '?action=notify;topic=' . $row['id_topic'] . '.0',
);



$scripturl is incorrect in TOPICLINK, but correct in UNSUBSCRIBELINK.  Nothing wrong with email template -

EmailTemplates.english.php



'notification_reply' => array(
/*
@additional_params: notification_reply
TOPICSUBJECT:
POSTERNAME:
TOPICLINK:
UNSUBSCRIBELINK:
@description:
*/
'subject' => 'Topic reply: {TOPICSUBJECT}',
'body' => 'A reply has been posted to a topic you are watching by {POSTERNAME}.

View the reply at: {TOPICLINK}

Unsubscribe to this topic by using this link: {UNSUBSCRIBELINK}

{REGARDS}',
),



It's happened twice. >:(

Title: Re: Incorrect url in topic notifications
Post by: Sir Osis of Liver on November 24, 2020, 12:04:41 PM
Should this be moved to bugs?
Title: Re: Incorrect url in topic notifications
Post by: Kindred on November 24, 2020, 12:40:48 PM
don't think so.... because I can not reproduce this on any of the three systems I tried on.

The issue is almost certainly some local modification
Title: Re: Incorrect url in topic notifications
Post by: Sir Osis of Liver on November 24, 2020, 12:50:33 PM
I'll ask if they've done anything, but doubt it.  Last package backup Feb 2020, don't see anything iffy in installed packages.  It's a GoDaddy account, but even GD couldn't cause this.  $replacements array is correct, email template is correct, something's borking $scripturl in TOPICLINK but not UNSUBSCRIBELINK in next line, doesn't make sense.
Title: Re: Incorrect url in topic notifications
Post by: Sir Osis of Liver on November 25, 2020, 11:02:48 AM
Did some test posts last night, all notifications were correct.  Apparently this only happens in notifications from the one member (admin) I'm corresponding with.  In addition to incorrect TOPICLINK, linebreaks are stripped.  Doesn't seem possible, but there it is.

A reply has been posted to a topic you are watching by Krashtest.

View the reply at: http://kotct2017.knightsofthecointable.com/index.php?topic=5941.new;topicseen#new

Unsubscribe to this topic by using this link: http://kotct2017.knightsofthecointable.com/index.php?action=notify;topic=5941.0

More replies may be posted, but you won't receive any more notifications until you read the topic.

Regards,
The KOTCT Team.


A reply has been posted to a topic you are watching by TKO™. View the reply at: http://kotct2017.knightsofthecoointable.com/index.php?topic=5941.new;topicseen#new Unsubscribe to this topic by using this link: http://kotct2017.knightsofthecointable.com/index.php?action=notify;topic=5941.0 More replies may be posted, but you won't receive any more notifications until you read the topic. Regards, The KOTCT Team.

Hmm, wonder if the ™ is causing it.  Will play with that tonight.