68 Classifieds Forums

Bad Character in title

This is a discussion on Bad Character in title within the v4 Modules / Modifications forums, part of the Help & Support category; Hi, When I post an ad with an Apostrophe in the Title like: "Nice 'Cats' " The system return in ...


Go Back   68 Classifieds Forums > Help & Support > v4 Modules / Modifications

Reply
 
LinkBack Thread Tools Display Modes
  #1  
Old 11-09-2008, 10:06 PM
hel68c's Avatar
Senior Member
 
Join Date: Jun 2008
Location: Canada, Quebec
Posts: 164
Rep Power: 6
hel68c is on a distinguished road
Default Bad Character in title

Hi,

When I post an ad with an Apostrophe in the Title like: "Nice 'Cats' " The system return in the Title "Nice \'Cats\' ". The description is OK.

Look at this ads Nice 'Cats'

Look the title and the description.

When I work at localhost everything is fine but since I transfered everything on the server it look like this.

I looked at PHPAdmin the database and all the file are type InnoDB but the total MyISAM.

Do you thing it could be it?

__________________
Serge
HobbyClassified.com
V4.08 Developper
Reply With Quote
  #2  
Old 11-10-2008, 10:39 AM
Eric Barnes's Avatar
68 Classifieds Staff
 
Join Date: Mar 2006
Location: Belmont, NC
Posts: 4,305
Rep Power: 99
Eric Barnes is a jewel in the rough
Default

It is probably because of different magic_quotes_gpc settings.

Did you add it locally and then import the database or add this new on the server?
__________________
Eric Barnes
68 Classifieds Developer
Please do not send me a private message asking for support. Instead use these open forums or our ticket system.

Customer Area | Issue Tracker | Documentation | 68C Mods | Submit a Ticket | Twitter
Reply With Quote
  #3  
Old 11-10-2008, 04:47 PM
hel68c's Avatar
Senior Member
 
Join Date: Jun 2008
Location: Canada, Quebec
Posts: 164
Rep Power: 6
hel68c is on a distinguished road
Default

I add this new on the server.

If I remove the backslash character " \ " in phpadmin. It display correctly. If I add a new listing on the server, It add Backslash character.
__________________
Serge
HobbyClassified.com
V4.08 Developper
Reply With Quote
  #4  
Old 11-10-2008, 05:20 PM
Eric Barnes's Avatar
68 Classifieds Staff
 
Join Date: Mar 2006
Location: Belmont, NC
Posts: 4,305
Rep Power: 99
Eric Barnes is a jewel in the rough
Default

Can you try this.

Open includes/functions.php and find:
Code:
function safeAddSlashes($theValue) 
{
    $theValue = (!get_magic_quotes_gpc()) ? stripslashes($theValue) : $theValue;
    $theValue = mysql_real_escape_string(trim($theValue));
    return $theValue;
}
Replace it with:
Code:
function safeAddSlashes($theValue) 
{
    $theValue = (get_magic_quotes_gpc()) ? stripslashes($theValue) : $theValue;
    $theValue = mysql_real_escape_string(trim($theValue));
    return $theValue;
}
__________________
Eric Barnes
68 Classifieds Developer
Please do not send me a private message asking for support. Instead use these open forums or our ticket system.

Customer Area | Issue Tracker | Documentation | 68C Mods | Submit a Ticket | Twitter
Reply With Quote
  #5  
Old 11-10-2008, 06:37 PM
hel68c's Avatar
Senior Member
 
Join Date: Jun 2008
Location: Canada, Quebec
Posts: 164
Rep Power: 6
hel68c is on a distinguished road
Default

Nope does'nt work,

I remarked something, I can remove the " \ " in the admin and the phpadmin but not at the place ads.
__________________
Serge
HobbyClassified.com
V4.08 Developper
Reply With Quote
  #6  
Old 11-12-2008, 07:38 AM
hel68c's Avatar
Senior Member
 
Join Date: Jun 2008
Location: Canada, Quebec
Posts: 164
Rep Power: 6
hel68c is on a distinguished road
Default

Hi Eric,

Do you fnd something else to correct this problem?
__________________
Serge
HobbyClassified.com
V4.08 Developper
Reply With Quote
  #7  
Old 11-12-2008, 09:11 AM
Maffo's Avatar
The Master
 
Join Date: Mar 2006
Location: British in Argentina
Posts: 1,399
Rep Power: 41
Maffo is a jewel in the rough
Default

I would recommend using HTML ENTITIES in your validation.

The correct ENTITY
Code:
' =& #39;
So in your validation you would need the PHP code

PHP Code:
$text_being_inspected str_replace("'""& #39;"$text_being_inspected); 
NOTE:I have place spaces between the & and the # so it displays on this page as code and not as an apostrophe. Be sure to remove the space!!
__________________
Super Mod v4 Is out and ready for download. DEMO
Purchase V4 Super Mod BETA at Reduced Price

Visit Me @ Classified-Sofware.co.uk

**Important** - All modules with the exceptions of the Bulk Upload System will be removed from my modshop on Tuesday September 30th. If you require a module you must get it before that date.
Reply With Quote
  #8  
Old 11-12-2008, 08:26 PM
hel68c's Avatar
Senior Member
 
Join Date: Jun 2008
Location: Canada, Quebec
Posts: 164
Rep Power: 6
hel68c is on a distinguished road
Default

I don't know if it can cause a problem, but in step3submit.php

I change this code:

PHP Code:
$data['title'] = isset( $_POST['title'] ) ? $format->inputSQL($_POST['title'], 'string') : ''
for this:
PHP Code:
$data['title'] = isset( $_POST['title'] ) ? $format->inputSQL($_POST['title'], 'stringHTML') : ''
and it work fine. Do you think it can cause a problem for the rest?
__________________
Serge
HobbyClassified.com
V4.08 Developper
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
character encoding seymourjames v4 Questions & Support 0 10-05-2008 06:02 AM
ISO Latin Character Sets seymourjames v4 Questions & Support 21 08-14-2008 05:41 PM
iso character sets again seymourjames v4 Modules / Modifications 4 07-22-2008 03:40 PM
German Character Set and Modifications eweiss v3.1 Questions & Support 2 10-02-2007 09:15 AM
Extra field character limit. Lhotch v3.1 Suggestions and Feedback 0 05-04-2006 04:33 PM


All times are GMT -4. The time now is 01:25 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22