ArcadeDownloadsNewslettersForum Menu
ForumSearchToday's Posts
NavigationWhat AWC Offers
MediaWiki Forum ExtensionProgramsMediaWiki ExtensionsIPB ScriptsFireFox StuffLinks
Wiki Tools
Upload file Special pagesEditHistoryRecent Changes
Login or Create Account

Log in

You must have cookies enabled to log in to Main Site - Local.

 
Log in / create account

email hook issue with quotes and/or double qoutes

From Another Web Company

Viewed 511 times, With a total of 5 Posts
Have a suggestion, improvement, change or non-beta Forum Entension bug ? Please add them to the todo list

Clicked A Few Times
Wiki Edits: 4
Threads 28
Posts 158
Hey AWC

I'm having this issue and I think it may be somewhere in the forum code...

I'm using:
$wgHooks['awcsforum_send_mail'][] = array($ge_awc_forum_hook_cls, 'send_mail');

I'm overriding $send_title and this is what's happening in my emails...

New Thread Title: This is a "TEST" title
Reply Titles: This is a

All the followup post emails lose whatever is after the 1st double qoute. I'm thinking maybe the subscribe.php object is not encoding or decoding correctly when the reply posts are read from the db? The main thread displays the title fine and of course you dont display the title in the thread posts... so I'm thinking its the $this->title in relation to the posts somehow?

Thanks for any tips!
Eric

Gets Around
Wiki Edits: 2757
Threads 117
Posts 1214
hey Eric...
Just tested it on home server and had the same problem, will look into it, should be a quick fix.

While testing, found a double quote bug with PM replies, was cutting them off in the replay title box, just fixed that.

_
~ What was once an opinion, became a fact, to be later proven wrong ~


Gets Around
Wiki Edits: 2757
Threads 117
Posts 1214
Fixed this problem, it requires a few file edits.

Here are the edits to fix the PM reply bug:

Edit file: extensions/awc/forums/members.php
Find:
$post_box->title = get_awcsforum_word('word_re') . ' '  . $r['pm_title'];
Add the following below that:
$post_box->title = awcsforum_funcs::awc_htmlentities($post_box->title);



  • For the subscription Email:
Edit file: extensions/awc/forums/thread.php
Find:
$posting_box->Thread_Title = awcsforum_funcs::awc_html_entity_decode($thread_title);

Replace that with:
$posting_box->Thread_Title = awcsforum_funcs::awc_htmlentities($thread_title);



Edit file: extensions/awc/forums/send_mail.php
Find:
$from_address = new MailAddress( $wgPasswordSender );

Add the following below that:
$send_title = str_replace(array('&', '"', ''', '''), array('&', '"', '\'', '\''), $send_title);
$send_body = str_replace(array('&', '"', ''', '''), array('&', '"', '\'', '\''), $send_body);



These changes will be in forum version 2.5.8 (soon to be released)

_

Clicked A Few Times
Wiki Edits: 4
Threads 28
Posts 158
Thanks for the information, I actually forgot I posted the question until another user used quotes in a posting today...

However....
Your code recommendation below locked the web page after I hit post. I just used decode on the title as I didnt have issues with the body. Why'd you use str_replace anyhow?

//$send_title = str_replace(array('&', '"', ''', '''), array('&', '"', '\'', '\''), $send_title);
//$send_body = str_replace(array('&', '"', ''', '''), array('&', '"', '\'', '\''), $send_body);
 
$send_title = html_entity_decode($send_title);


I've tested my posted and they work great now! Thanks!!

Clicked A Few Times
Wiki Edits: 4
Threads 28
Posts 158
Oh, by the way.. this is how I have my forum email setup... works pretty well!

File:Forum_email_example.JPG

Gets Around
Wiki Edits: 2757
Threads 117
Posts 1214
Quote:Kenyu73 Jan 21st 9:43 am
Why'd you use str_replace anyhow?

Security, the forum uses some Wiki function to make sure javascript and what not can not be posted, with the changes above i wanted to make sure the emails where secure also (im sure that will not effect you at work, but being this was posted publicly i wanted to be safe), html_entity_decode() will let "bad" stuff to be passed.


Glad you have it working, will look into why it locked you up with the str_replace() when i get time.

[edited]
Your Email format looks good, nice and clean
_
Edited On 2:04:34 AM - Saturday 23rd, January 2010 by AWC


Forum Image:Icon-double-arrow.gif AWC's Corner Image:Icon-double-arrow.gif AWC's MediaWiki Forum Extension



Whos here now: Members 0 Guests 0 Bots/Crawlers: 1


AWC's: 2.5.8 MediaWiki - Stand Alone Forum Extension
Forum theme style by: AWC