PHP Web Host - Quality Web Hosting For All PHP Applications Free RavenNuke(tm) Add Ons
  Login or Register
 • Home • Downloads • Your Account • Forums • 

View next topic
View previous topic


Google
 
Web RavenPHPScripts (This Site)
Post new topic   Reply to topic
Author Message
pnclthnmstsh
Regular
Regular


Joined: Oct 23, 2005
Posts: 54
Location: Portland, Or

PostPosted: Sun Sep 24, 2006 4:23 pm Reply with quote Back to top

There's a few mods out there that use stripslashes in sections that allow comments and such. I'm pretty much just learning how to write mods myself and have found that stripslashes won't let you use apostropies if the entry is going to a database entry. A good example is EDL...if you use an apostrophe in the description the entire entry won't be saved.

So, to offset this, I have been changing the stripslashes to eregi_replace to allow apostrophies in the entries. I am almost positive this is the wrong way to accomplish what I want. It works but I'm not sure if I've compromised any security.

Thanks for any input on these.
View user's profile Send private message Visit poster's website Yahoo Messenger
evaders99
Former Moderator in Good Standing


Joined: Apr 30, 2004
Posts: 3221

PostPosted: Sun Sep 24, 2006 7:53 pm Reply with quote Back to top

Do not use stripslashes.. it does not provide any security.

For database entry for apostreophes, use addslashes
View user's profile Send private message Visit poster's website
spottedhog
Regular
Regular


Joined: Jun 02, 2004
Posts: 88

PostPosted: Sun Sep 24, 2006 7:58 pm Reply with quote Back to top

Look at the topic about Filtering.... Earlier I posted some code for an Input Filtering system, which is basically what you are needing. This system covers what you are asking.

Database inputs should be filtered and escaped. "Escaped" means that certain characters need to have a backslash added in front of them before being stored in a database.

Changing stripslashes to eregi_replace is one big no-no..... and is really comparing apples to oranges. Those functions have 2 entirely different purposes and uses.

Go to php.net and read about the following:

addslashes
stripslashes
magic_quotes_gpc
mysql_real_escape_string
View user's profile Send private message Visit poster's website
pnclthnmstsh
Regular
Regular


Joined: Oct 23, 2005
Posts: 54
Location: Portland, Or

PostPosted: Sun Sep 24, 2006 8:00 pm Reply with quote Back to top

Good to know. Thank you Evaders.

The reason I replaced stripslashes tho is because I couldn't find a combination of commands to not have to use a backslash or double apostrophies. So I commented out the stripslashes line and added eregi_replace("/'","" etc etc to get the backslashes in there.

Thanks for the info hog. I'll check out your post.
View user's profile Send private message Visit poster's website Yahoo Messenger
Display posts from previous:       
Post new topic   Reply to topic

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Forums ©
 

All logos and trademarks in this site are property of their respective owner.
The comments are property of their posters, all the rest © 2002-2011 by Raven

You can syndicate our news using the file xml

CSE HTML Validator Helped Clean up This Page! [Valid RSS] valid RSS 2.0 Valid robots.txt Stop Spam Harvesters, Join Project Honey Pot

Website engines core code is © copyright by PHP-Nuke but has been heavily patched and modified by myself and others.
PHP-Nuke is a free software released under the GNU/GPL.


:: fisubice phpbb2 style by Daz :: PHP-Nuke theme by www.nukemods.com ::
:: fisubice Theme Modified by the RavenNuke™ Team ::

:: W3C CSS Compliance Validation :: W3C HTML 4.01 Transitional Compliance Validation ::

zerosum