Page 1 of 1
[SOLVED]Apostrophes in signature (2.0.20 issue)

Posted:
Sat Jun 24, 2006 11:12 pm
Author: computerskillz
in reference to this post right here
http://integramod.com/forum/viewtopic.php?p=5287#5287I notice that not only do I have this problem on my site, but it exists on Integramod2 as well.
Has a fix been found yet?
If not, which 2.0.20 manual edit(s) can I safely undo (because I didn't have this problem before until after I upgraded), to temporarily resolve this?
Re: Apostrophes in signature (2.0.20 issue)

Posted:
Wed Jun 28, 2006 2:26 pm
Author: computerskillz
Hi,
Is there a planned fix for this now or for the next upgrade? Or are there currently no plans at all for this bug?
Re: Apostrophes in signature (2.0.20 issue)

Posted:
Wed Jun 28, 2006 3:18 pm
Author: Teelk
Open profilcp/profilcp_profil_signature.php
FIND
- Code: Select all
$signature = str_replace( '<br>', "n", trim(str_replace("'", "''", $HTTP_POST_VARS['message'])) );
REPLACE WITH
- Code: Select all
$signature = str_replace( '<br>', "n", trim(str_replace("'", "'", $HTTP_POST_VARS['message'])) );

Posted:
Wed Jun 28, 2006 4:48 pm
Author: computerskillz
That throws the following error when submitting an apostrophe
[code]Could not update user table DEBUG MODE SQL Error ]
do we need an escape somewhere?
Re: Apostrophes in signature (2.0.20 issue)

Posted:
Wed Jun 28, 2006 5:10 pm
Author: Teelk
Strange... I'm not getting any errors... I'll check it out.
Re: Apostrophes in signature (2.0.20 issue)

Posted:
Wed Aug 02, 2006 5:56 pm
Author: Master Dwarf
Hey Teelk, I updated the code per your instruction. Now it turns the single apostrophe into two of them. Just to clarify, it's not quotes but two apostrophes.
Interesting bug.
Re: Apostrophes in signature (2.0.20 issue)

Posted:
Wed Aug 02, 2006 9:22 pm
Author: Teelk
Undo the above changes and apply the following...
Open profilcp/profilcp_profil_signature.php
FIND
- Code: Select all
if ($submit) { $signature = str_replace( '<br>', "n", trim(str_replace("'", "'", $HTTP_POST_VARS['message'])) );
REPLACE WITH
- Code: Select all
if ($submit) { $signature = (isset($HTTP_POST_VARS['message'])) ? str_replace( '<br>', "n", trim(str_replace("'", "'", $HTTP_POST_VARS['message']))) ]
FIND[code] $signature = $view_userdata['user_sig'];[/code]REPLACE WITH[code] $signature = stripslashes($view_userdata['user_sig']);
Re: Apostrophes in signature (2.0.20 issue)

Posted:
Thu Aug 03, 2006 6:02 am
Author: Master Dwarf
Teelk: Correct me if I'm wrong, the second change had two lines that had the following:
$signature = $view_userdata['user_sig'];
So I changed both.
Good news: it worked, my sig is displayed properly
Bad news: It gives me an error when I hit submit on the signature tab of the user profile page (profile.php)
DEBUG MODE
SQL Error : 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 's Age of Worms [url=http]Wiki[/url] | [url=http]Blog[/url]', user_sig_bbcode_uid = '13e67c646f' WHERE user_id = 2
Line : 88
File : profilcp_profil_signature.php
Thanks for looking into this. <img>
Re: Apostrophes in signature (2.0.20 issue)

Posted:
Thu Aug 03, 2006 6:18 am
Author: Teelk
Hmmm...
Looks like there may be a problem with the URL in your sig. Can you post exactly what your inputing for your sig plz?

Posted:
Thu Aug 03, 2006 6:48 am
Author: Master Dwarf
Here you go:
Sean Kelley
Eberron's Age of Worms
[url=http]Wiki[/url] | [url=http]Blog[/url]
Guess my only question is why would I not get the error before I make the code changes? It works fine with the original code in place, but then I get the double apostrophes.
Update: Something is amuck. I have to check my edits. I tried it all over again and it wouldn't let me into my profile at all.
I'll dedicate some time to checking it out and then get back to you. I think this is a bug in the code, and not just my site. I tried the apostrophe in another updated Integramod-based site and it brought in the slash. Most people probably aren't aware of the issue so they haven't brought it up.
Re: Apostrophes in signature (2.0.20 issue)

Posted:
Thu Aug 03, 2006 7:15 am
Author: Teelk
Ok, undo anything you may have done so far...
I'm pretty sure I've got it this time lol...
Open profilcp/profilcp_profil_signature.php
FIND
- Code: Select all
if ($submit) { $signature = str_replace( '<br>', "n", trim(str_replace("'", "''", $HTTP_POST_VARS['message'])) ); }
REPLACE WITH
- Code: Select all
if ($submit) { $signature = (isset($HTTP_POST_VARS['message'])) ? str_replace('<br>', "n", $HTTP_POST_VARS['message']) ]
FIND[code] user_sig = '" . $signature . "',[/code]
REPLACE WITH[code] user_sig = '" . str_replace("'", "''", $signature) . "',[/code]
FIND[code] $signature = $view_userdata['user_sig'];[/code]
REPLACE WITH[code] $signature = htmlspecialchars(stripslashes($view_userdata['user_sig']));
Re: Apostrophes in signature (2.0.20 issue)

Posted:
Thu Aug 03, 2006 12:31 pm
Author: Master Dwarf
I saved the original. I'll start from there and do what you've noted. I'll get back with results.
Update: Nice hack Teelk! It worked fine with your last code changes. The sig displays no problem and there is no error when previewing the sig, submitting it, or viewing a post with it. Thank you. I think the original files need this implemented, many folks may be subjected to the bug but may not be aware of it.
This thread and can be marked [Solved].
Re: [SOLVED]Apostrophes in signature (2.0.20 issue)

Posted:
Thu Aug 03, 2006 9:20 pm
Author: Teelk
Thanks for testin' it for me.

Posted:
Thu Aug 03, 2006 9:34 pm
Author: Master Dwarf
Any time.

Posted:
Thu Aug 31, 2006 10:11 pm
Author: gcomfx.com
Apparently this didn't make it into 2.0.21???
I tried the above fix and it gave me an error on line 49. Have to try it again when I've had more sleep. LOL

Posted:
Sat Sep 09, 2006 11:20 pm
Author: computerz
I tested it too. It works.
Nice job Teelk

Posted:
Fri Nov 10, 2006 8:10 pm
Author: zenrei
this fix doesn't seem to work with 2.0.21, it's not working for me either, gcom
Re: [SOLVED]Apostrophes in signature (2.0.20 issue)

Posted:
Sat Nov 11, 2006 1:10 am
Author: Teelk
I'm fairly certain those are the code edits I used for 141, so they should work. They're working here...
But, if I'm mistaken, you should be able to take the profilcp/profilcp_profil_signature.php from the latest rev of 141 and overwrite your 140 copy. Make a backup first.

Posted:
Sat Nov 11, 2006 7:39 am
Author: zenrei
"Teelk" wrote:I'm fairly certain those are the code edits I used for 141, so they should work. They're working here...
But, if I'm mistaken, you should be able to take the profilcp/profilcp_profil_signature.php from the latest rev of 141 and overwrite your 140 copy. Make a backup first.
sweet


Posted:
Sat Nov 11, 2006 7:40 am
Author: zenrei
.. the link to download 141 is broken

Posted:
Mon Nov 13, 2006 7:59 am
Author: gcomfx.com
"zenrei";p="17514" wrote:this fix doesn't seem to work with 2.0.21, it's not working for me either, gcom
When you find a solution, please reply here as I still haven't been able to get this one to work. <img>

Posted:
Tue Nov 14, 2006 5:21 pm
Author: zenrei
no problem
Re: [SOLVED]Apostrophes in signature (2.0.20 issue)

Posted:
Tue Nov 14, 2006 6:09 pm
Author: Teelk
I'm not certain about the link to the beta, as that's not my area. But, I'll inquire about it. In the meantime, here's the file.

Posted:
Wed Nov 15, 2006 7:58 am
Author: gcomfx.com
Teelk - just uploaded that file on my forum. I edited a members sig that had multiple apostrophes with success. I'm trying to get a few members to confirm from a normal user account. But so far so good. I'll report back when I learn more. <img>

Posted:
Thu Nov 16, 2006 11:16 am
Author: zenrei
worked like a charm for me... they just had to go back and correct their sigs, but it definitely took!
Thank you!!

Posted:
Thu Nov 16, 2006 12:42 pm
Author: gcomfx.com
Same here... thanks Teelk!
Re: [SOLVED]Apostrophes in signature (2.0.20 issue)

Posted:
Thu Nov 16, 2006 6:03 pm
Author: Teelk
No problemo <img>