5
Here is what I did as a temporary solution.
Basically, what we want to do is 'sanitize' the title of the notification. This value is normally set in that way :
Quote:
$tags['STORY_NAME'] = $subject;
The new way should then be something like this :
Quote:
$tags['STORY_NAME'] = Sanitize_For_Notification($subject);
So I created the other function. In class/module.textsanitizer.php, just before those lines :
Quote:
##################### Deprecated Methods ######################
I added this new function :
Quote:
/**
* Prepare a string to be sent by notifiction (by marcan)
*
* @param string $text
* @return string
**/
function &prepareForNotification(&$text)
{
return stripslashes($this->undoHtmlSpecialChars($text));
}
This function clears all the unwanted chars. Then, in every module that uses the notification you would have to 'sanitize' the text. Here is an example with the news module.
In news/admin/index.php, around line 366 in the Function addTopic(), change this :
Quote:
$tags['TOPIC_NAME'] = $HTTP_POST_VARS['topic_title'];
For this :
Quote:
// Hack by marcan to display the title in a good format, without ''' symbols...
$myts =& MyTextSanitizer::getInstance();
// $tags['TOPIC_NAME'] = $HTTP_POST_VARS['topic_title'];
$tags['TOPIC_NAME'] = $myts -> prepareForNotification($HTTP_POST_VARS['topic_title']);
// End of hack by marcan
Then, in that same file, around line 590, change this :
Quote:
$tags['STORY_NAME'] = $story -> title();
With for :
Quote:
// Hack by marcan to display notification in a good format
$myts =& MyTextSanitizer::getInstance();
// $tags['STORY_NAME'] = $story -> title();
$tags['STORY_NAME'] = $myts -> prepareForNotification($story -> title());
// End of hack by marcan
This fixes the notification when a news is submitted via the admin side. Here's what you need to do in order to fix it for when a user submit an article.In submit.php, around line 110, change this :
Quote:
// $tags['STORY_NAME'] = $subject;
For this :
Quote:
// Hack by marcan to display notification in a good format
$myts =& MyTextSanitizer::getInstance();
// $tags['STORY_NAME'] = $subject;
$tags['STORY_NAME'] = $myts -> prepareForNotification($subject);
// End of hack by marcan
That's it. This worked for me !
Now 2 questions :
1- Is it working for you ?
2- Coders : is it the good way to do it?