brainonastick Posted June 18, 2007 Posted June 18, 2007 I have discovered that i have magic quotes turned on in my php.ini file. If I turn them off will this affect the FX.php plug-in adversely? I can't validate apostrophes in text fields using regular expressions while mahic quotes are turned on.
Genx Posted June 18, 2007 Posted June 18, 2007 I can't validate apostrophes in text fields using regular expressions while mahic quotes are turned on. ... Why not? Use an escape character: e.g. '''
brainonastick Posted June 18, 2007 Author Posted June 18, 2007 See http://www.jimmysworld.org/article.html?aID=59 re how annoying magic quotes are. Here's the code: if(preg_match('/^[a-zA-Z0-9'-, ]+$/', $payername_1) != 1) {$errors['payername']= 'The payer name may only contain text.';} If I add ' if(preg_match('/^[a-zA-Z0-9'-,' ]+$/', $payername_1) != 1) {$errors['payername']= 'The payer name may only contain text.';} the script still rejects apostophes. Cheers, Steven
Genx Posted June 21, 2007 Posted June 21, 2007 Anyway, better idea: if( get_magic_quotes_gpc() ) $payername_1 = stripslashes($payername_1) ; then do your preg_matching.
brainonastick Posted June 30, 2007 Author Posted June 30, 2007 Thanks Genx, A friend suggested I run phpinfo.php to see where in our server the magic_quotes_gpc file was located. It was found without difficulty and our IT Manager switched the annoying things off. It hasnt had any advers effect on FX.php or our system. Thanks, Steven
Recommended Posts
This topic is 6425 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now