June 18, 200718 yr 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.
June 18, 200718 yr 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. '''
June 18, 200718 yr Author 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
June 21, 200718 yr Anyway, better idea: if( get_magic_quotes_gpc() ) $payername_1 = stripslashes($payername_1) ; then do your preg_matching.
June 30, 200718 yr Author 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
Create an account or sign in to comment