After bridging, PM Reply e-mail link going to the wrong recipients

Started by Archer5280, June 12, 2007, 06:24:27 PM

Previous topic - Next topic

Archer5280

Hello.

I'm having an issue with my SMF forum after applying the SMF/Joomla Bridge. When users receive an e-mail notification for a private message, the Reply link at the bottom of the message sends them to the right message, but the wrong user name appears in the To: field, or no user name appears at all.

The problem seems related to the value for "u=x" in the Reply url. For example, a user might receive:

hxxp:mydomain.com/portal/index.php?option=com_smf&Itemid=100&action=pm;sa=send;f=inbox;pmsg=1577;quote;u= [nonactive]

Note there is no value for "u=" at the end of the URL, which leaves the To: field blank. It should be populated by the SMF user ID of the member who sent the PM. Other times, "u=" may be populated with the wrong user ID, so if the user doesn't notice, they reply to the wrong recipient. Other times the user ID may be correct. The results are inconsistent.

Any idea what may be causing this?

SMF Version: 1.1.2
Joomla Version: 1.0.12
Bridge Version: 1.1.7
My databases can talk to each other.

Thanks very much.
Douglas

Orstio

In your components/com_smf folder is a file named smf.php.

With a text editor, find the integrate_outgoing_email function, and change it to this:

function integrate_outgoing_email($subject, &$message, $headers)
{
global $boardurl, $mosConfig_live_site, $Itemid, $scripturl, $mosConfig_sef, $modSettings, $Itemid, $hotmail_fix;

//First, we need to set up the email so that ob_mambofix knows what to do with it
$message = str_replace ($scripturl, '="' . $scripturl, $message);
$message = preg_replace ('/(http.+)(\b)/', '$1"', $message);
$message = ob_mambofix($message);
//Now we need to undo those changes so the email looks normal again
$message = str_replace ('="', '', $message);
$message = preg_replace ('/(http.+)(")/', '$1', $message);
//THis is an email, after all, so let's make sure entities and special characters are text, not HTML
$message = trim($message);
    $message = html_entity_decode($message);
$message = un_htmlspecialchars($message);
$hotmail_fix = false;
return true;
}

Archer5280

Orstio, I wanted to let you know this appears to have worked. Thanks very much for the fast help.

Is this a bugfix that will be included in a later release of the bridge, or is there something else going on here I should be aware of?

Orstio

It will be included in the next release.  I am awaiting some testing before releasing 1.1.8. 

Oddly, the issue doesn't seem to affect all bridged forums. 

Advertisement: