Source of: /manual/en/security.magicquotes.whynot.php
<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/security.magicquotes.inc";
$setup = array (
'home' =>
array (
0 => 'index.php',
1 => 'PHP Manual',
),
'head' =>
array (
0 => 'UTF-8',
1 => 'en',
),
'this' =>
array (
0 => 'security.magicquotes.whynot.php',
1 => 'Why not to use Magic Quotes',
),
'up' =>
array (
0 => 'security.magicquotes.php',
1 => 'Magic Quotes',
),
'prev' =>
array (
0 => 'security.magicquotes.why.php',
1 => 'Why did we use Magic Quotes',
),
'next' =>
array (
0 => 'security.magicquotes.disabling.php',
1 => 'Disabling Magic Quotes',
),
);
$setup["toc"] = $TOC;
$setup["parents"] = $PARENTS;
manual_setup($setup);
manual_header();
?>
<div id="security.magicquotes.whynot" class="sect1">
<h2 class="title">Why not to use Magic Quotes</h2>
<div class="warning"><b class="warning">Warning</b><p class="simpara">This feature has been
<em class="emphasis">DEPRECATED</em> as of PHP 5.3.0 and <em class="emphasis">REMOVED</em> as of PHP 6.0.0.
Relying on this feature is highly discouraged.</p></div>
<ul class="itemizedlist">
<li class="listitem">
<span class="simpara">
Portability
</span>
<span class="simpara">
Assuming it to be on, or off, affects portability. Use
<a href="function.get-magic-quotes-gpc.php" class="function">get_magic_quotes_gpc()</a> to check for this, and code
accordingly.
</span>
</li>
<li class="listitem">
<span class="simpara">
Performance
</span>
<span class="simpara">
Because not every piece of escaped data is inserted into a
database, there is a performance loss for escaping all this data.
Simply calling on the escaping functions (like
<a href="function.addslashes.php" class="function">addslashes()</a>) at runtime is more efficient.
</span>
<span class="simpara">
Although <var class="filename">php.ini-development</var> enables these directives
by default, <var class="filename">php.ini-production</var> disables it.
This recommendation is mainly due to performance reasons.
</span>
</li>
<li class="listitem">
<span class="simpara">
Inconvenience
</span>
<span class="simpara">
Because not all data needs escaping, it's often annoying to see escaped
data where it shouldn't be. For example, emailing from a form, and
seeing a bunch of \' within the email. To fix, this may require
excessive use of <a href="function.stripslashes.php" class="function">stripslashes()</a>.
</span>
</li>
</ul>
</div><?php manual_footer(); ?>