Previous Next
EVS RSArrayUtil

MagicQuotesUtil

A Utility Class for handling MagicQuotes

Table of Contents

Introduction

PHP is a very good choice for writing system independent code. But true system independence does not just mean OS independence. You application should run on every system with no matter what php configuration applied! Dealing with magic quotes is one step in this direction. I do not think that turning magic_quotes_gpc/magic_quotes_sybase on is a very good thing to do because your application will essentially relay on an external configuration. Besides that, there are a lot of situation where you do not need your data escaped.

What MagicQuotesUtil does is to undo all magic quoting performed by the PHP Engine.

Usage


1 <?php
2 require_once('MagicQuotesUtil/MagicQuotesUtil.php');
3 MagicQuotesUtil::undo();
4 ?>
This removes the magic quotes from $HTTP_GET_VARS, $HTTP_POST_VARS, $HTTP_COOKIE_VARS, $_REQUEST, $_GET, $_POST and $_COOKIE. Please note that global variables will stay untouched! You can call the method undo only once. Calling it a second time will have no effect.

Previous Next
EVS RSArrayUtil

Documentation generated on Mon, 8 Dec 2003 13:09:33 +0100 by phpDocumentor 1.2.3