[SOLVED]Apostrophes in signature (2.0.20 issue)

Support for IntegraMOD 140

Moderator: Integra Moderator

[SOLVED]Apostrophes in signature (2.0.20 issue)

PostAuthor: computerskillz » Sat Jun 24, 2006 11:12 pm

in reference to this post right here http://integramod.com/forum/viewtopic.php?p=5287#5287

I 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?
Last edited by computerskillz on Wed Jun 28, 2006 2:30 pm, edited 1 time in total.
testing apostrophe''s in the singature''''s

computerskillz
Members
Members
 
Posts: 45
Likes: 0 post
Liked in: 0 post
Joined: Thu May 18, 2006 1:23 pm
Cash on hand: 0.00

Re: Apostrophes in signature (2.0.20 issue)

PostAuthor: computerskillz » Wed Jun 28, 2006 2:26 pm

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?
Last edited by computerskillz on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.
testing apostrophe''s in the singature''''s

computerskillz
Members
Members
 
Posts: 45
Likes: 0 post
Liked in: 0 post
Joined: Thu May 18, 2006 1:23 pm
Cash on hand: 0.00

Re: Apostrophes in signature (2.0.20 issue)

PostAuthor: Teelk » Wed Jun 28, 2006 3:18 pm

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'])) );
Last edited by Teelk on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.
User avatar
Teelk
Dev Team
Dev Team
 
Posts: 1309
Likes: 0 post
Liked in: 0 post
Joined: Tue Mar 14, 2006 6:25 pm
Cash on hand: 0.00
Location: Canada

PostAuthor: computerskillz » Wed Jun 28, 2006 4:48 pm

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?
Last edited by computerskillz on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.
testing apostrophe''s in the singature''''s

computerskillz
Members
Members
 
Posts: 45
Likes: 0 post
Liked in: 0 post
Joined: Thu May 18, 2006 1:23 pm
Cash on hand: 0.00

Re: Apostrophes in signature (2.0.20 issue)

PostAuthor: Teelk » Wed Jun 28, 2006 5:10 pm

Strange... I'm not getting any errors... I'll check it out.
Last edited by Teelk on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.
User avatar
Teelk
Dev Team
Dev Team
 
Posts: 1309
Likes: 0 post
Liked in: 0 post
Joined: Tue Mar 14, 2006 6:25 pm
Cash on hand: 0.00
Location: Canada

Re: Apostrophes in signature (2.0.20 issue)

PostAuthor: Master Dwarf » Wed Aug 02, 2006 5:56 pm

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.
Last edited by Master Dwarf on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.
Sean Kelley
http://www.GrumblingDwarf.com
Wisconsin Region Game Site
User avatar
Master Dwarf
Integra Supporter
Integra Supporter
 
Posts: 102
Likes: 0 post
Liked in: 0 post
Joined: Sun Apr 09, 2006 9:26 am
Cash on hand: 0.00
Location: Madison, WI

Re: Apostrophes in signature (2.0.20 issue)

PostAuthor: Teelk » Wed Aug 02, 2006 9:22 pm

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']);
Last edited by Teelk on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.
User avatar
Teelk
Dev Team
Dev Team
 
Posts: 1309
Likes: 0 post
Liked in: 0 post
Joined: Tue Mar 14, 2006 6:25 pm
Cash on hand: 0.00
Location: Canada

Re: Apostrophes in signature (2.0.20 issue)

PostAuthor: Master Dwarf » Thu Aug 03, 2006 6:02 am

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>
Last edited by Master Dwarf on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.
Sean Kelley
http://www.GrumblingDwarf.com
Wisconsin Region Game Site
User avatar
Master Dwarf
Integra Supporter
Integra Supporter
 
Posts: 102
Likes: 0 post
Liked in: 0 post
Joined: Sun Apr 09, 2006 9:26 am
Cash on hand: 0.00
Location: Madison, WI

Re: Apostrophes in signature (2.0.20 issue)

PostAuthor: Teelk » Thu Aug 03, 2006 6:18 am

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?
Last edited by Teelk on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.
User avatar
Teelk
Dev Team
Dev Team
 
Posts: 1309
Likes: 0 post
Liked in: 0 post
Joined: Tue Mar 14, 2006 6:25 pm
Cash on hand: 0.00
Location: Canada

PostAuthor: Master Dwarf » Thu Aug 03, 2006 6:48 am

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.
Last edited by Master Dwarf on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.
Sean Kelley
http://www.GrumblingDwarf.com
Wisconsin Region Game Site
User avatar
Master Dwarf
Integra Supporter
Integra Supporter
 
Posts: 102
Likes: 0 post
Liked in: 0 post
Joined: Sun Apr 09, 2006 9:26 am
Cash on hand: 0.00
Location: Madison, WI

Re: Apostrophes in signature (2.0.20 issue)

PostAuthor: Teelk » Thu Aug 03, 2006 7:15 am

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']));
Last edited by Teelk on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.
User avatar
Teelk
Dev Team
Dev Team
 
Posts: 1309
Likes: 0 post
Liked in: 0 post
Joined: Tue Mar 14, 2006 6:25 pm
Cash on hand: 0.00
Location: Canada

Re: Apostrophes in signature (2.0.20 issue)

PostAuthor: Master Dwarf » Thu Aug 03, 2006 12:31 pm

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].
Last edited by Master Dwarf on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.
Sean Kelley
http://www.GrumblingDwarf.com
Wisconsin Region Game Site
User avatar
Master Dwarf
Integra Supporter
Integra Supporter
 
Posts: 102
Likes: 0 post
Liked in: 0 post
Joined: Sun Apr 09, 2006 9:26 am
Cash on hand: 0.00
Location: Madison, WI

Re: [SOLVED]Apostrophes in signature (2.0.20 issue)

PostAuthor: Teelk » Thu Aug 03, 2006 9:20 pm

Thanks for testin' it for me.
Last edited by Teelk on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.
User avatar
Teelk
Dev Team
Dev Team
 
Posts: 1309
Likes: 0 post
Liked in: 0 post
Joined: Tue Mar 14, 2006 6:25 pm
Cash on hand: 0.00
Location: Canada

PostAuthor: Master Dwarf » Thu Aug 03, 2006 9:34 pm

Any time.
Last edited by Master Dwarf on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.
Sean Kelley
http://www.GrumblingDwarf.com
Wisconsin Region Game Site
User avatar
Master Dwarf
Integra Supporter
Integra Supporter
 
Posts: 102
Likes: 0 post
Liked in: 0 post
Joined: Sun Apr 09, 2006 9:26 am
Cash on hand: 0.00
Location: Madison, WI

PostAuthor: gcomfx.com » Thu Aug 31, 2006 10:11 pm

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
Last edited by gcomfx.com on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.
Paul (gcomfx) - 100mphclub.com originator
[size=99px]
User avatar
gcomfx.com
Sr Integra Member
Sr Integra Member
 
Posts: 251
Likes: 0 post
Liked in: 0 post
Joined: Wed Apr 12, 2006 9:34 am
Cash on hand: 0.00

Next

Return to IntegraMOD 140

Who is online

Registered users: Bing [Bot], Google [Bot], Helter, Vendethiel