PDA

View Full Version : Admin Comment field - problem with '


Mark Brookes
11-19-2006, 04:22 PM
Hi

I tried to modify a link and got an error message (below) which seems to be due to an apostrophe in the text previously imported into the field. See the work "cat't"

This has been easy to solve - dont use " ' "
But I feel that using keyboard characters should not cause an error in any field, do you agree?

Regards
Mark

Text which caused eror message:
ACTIVE // R=7,V=8,PR=50 // // 25oct2005 email in. They can't find link --- email out with details // 27-sep-04 email in - wrong recipient // 27-Sep-04 email out = False deleting-link emails // Reply says link swap will be set up soon 2-Jul-2004 // Email proposal_01 07/02/04


Text which saved ok
ACTIVE // R=7,V=8,PR=50 // // 25oct2005 email in. They cant find link --- email out with details // 27-sep-04 email in - wrong recipient // 27-Sep-04 email out = False deleting-link emails // Reply says link swap will be set up soon 2-Jul-2004 // Email proposal_01 07/02/04

Error message
Error: 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 't find link --- email out with details // 27-sep-04 email in - wrong recipient' at line 1
UPDATE `FSlinksV20_links` SET `id` = '111', `recip_valid` = '0', `status` = 'approval', `rank` = '0', `comment` = 'ACTIVE // R=7,V=8,PR=50 // // 25oct2005 email in. They can't find link --- email out with details // 27-sep-04 email in - wrong recipient // 27-Sep-04 email out = False deleting-link emails // Reply says link swap will be set up soon 2-Jul-2004 // Email proposal_01 07/02/04', `title` = 'Evergreen Memories', `url` = 'http://www.evergreenmemories.ca/', `description` = 'Give the gift of nature. Tree seedlings & seeds from Evergreen Memories.... Evergreen Memories tree seedlings are perfect gifts for weddings. [Canada]', `reciprocal` = 'http://www.evergreenmemories.ca/links.html', `email` = 'greengifts@evergreenmemories.ca', `id` = '111' WHERE `id` = '111'

Dave Baker
11-19-2006, 09:10 PM
Mark I have tried methods of creation and editing of links from Admin Panel and the user side and have not received negative result. Please, describe in details where you entered this data.

Mark Brookes
11-20-2006, 12:41 PM
Hi Dave,

In Admin Comment field - while editing listing ,

Johnny
11-20-2006, 04:35 PM
Hi Dave,

In Admin Comment field - while editing listing ,

I have the same issue as well. It take me a while to realize that it is the single quot that is causing the issue.

Mark Brookes
11-20-2006, 04:56 PM
Hi Johnny

Thanks for your comment - I am sure it helps the support people to know that it is a general problem and not just something to do with my installation.

regarsd
Mark

Dave Baker
11-21-2006, 05:22 PM
Mark thanks for explanations, I've found this problem
***Open admin/edit-link.php and find code (around 45th line)***

$temp['comment'] = $_POST['comment'];

***Below add following code***

$temp['comment'] = sql(html($temp['comment'],ENT_NOQUOTES));

***Save file***

Mark Brookes
11-21-2006, 06:13 PM
Hello Dave,

Thanks for your code to correct the problem with apostrophies in the admin-comment field. When I click 'save changes' it does not crash anymore.

Unfortunately it no longer saves anything I type into the field :confused: :huh:

regards
Mark

Dave Baker
11-21-2006, 07:07 PM
Unfortunately it no longer saves anything I type into the field
It's very strangely.
Try to use following code

$temp['comment'] = sql($temp['comment']);

***Instead of***

$temp['comment'] = sql(html($temp['comment'],ENT_NOQUOTES));

***Or this code***

$temp['comment'] = sql($temp['comment']);
echo ($temp['comment']);

In this case you will see value of comment field in top of browser after click 'save changes'. If the text will appear, the problem does not concern to changes.

Mark Brookes
11-22-2006, 08:27 AM
Hello Dave,

Unfortunately Neither code change seems to have solved it. Also I could not see the text of my test message-value of comment field in top of browser after click 'save changes'.

As I say earlier I am content for now to avoid using apostrophe's but I think the issue represents a bug. I have a hihger priority on some of my support ticket problems - nevertheless if you want to investigate this in case it is a bug you can find my log in details in ticket number VYU-989411, QBJ-390489, or XHN-532876

regards
Mark

Dave Baker
11-23-2006, 11:36 PM
Hello Mark,
I have made changes in your directory /test-wedding-links/, used only this post http://www.esyndicat.com/forum/post52580-6.html . All seems works normally. Value remains saved. Please try to check it :)

Mark Brookes
11-24-2006, 10:12 AM
Hello Dave,

Yes, the test directory changes to Admin-Comments fields have saved & have worked with apostrophies

I have done a line by line check of the code in admin/edit-link.php comparing my live version & the test version & have discovered the problem.

In my live version at line 46 there was a line of code which should not have been there. (Bother I have now deleted the actual code) It was code saying something like :
echo $temp['comment'] =

Now I have checked my records of all code changes that I know about, and it was not one of those, so where it actually came from I can't tell. It was NOT in the code of my original downloaded eSC zip file so it must have been added later.

Anyway - Once that line of code has been taken out and the modification you provided above $temp['comment'] = sql(html($temp['comment'],ENT_NOQUOTES)); has been applied the admin-edit function now works properly for the admin-comment field.

So, thank you for your help, in solving the original bug, and sorry for the confusion applying to my installation only after you provided the answer
Mark