{"id":760,"date":"2012-09-10T00:03:07","date_gmt":"2012-09-10T06:03:07","guid":{"rendered":"http:\/\/blog.supportpro.com\/?p=760"},"modified":"2018-10-04T04:08:21","modified_gmt":"2018-10-04T10:08:21","slug":"magic-quotes","status":"publish","type":"post","link":"https:\/\/www.supportpro.com\/blog\/magic-quotes\/","title":{"rendered":"Magic quotes"},"content":{"rendered":"<div id=\"_mcePaste\" style=\"position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow: hidden;\">Magic quotes is a module of php which was implemented in older versions of PHP. In latest versions, the module is depreciated. It is for the purpose of processing of escaping special characters with a &#8216;\\&#8217; to allow a string to be entered into a database.<\/div>\n<div id=\"_mcePaste\" style=\"position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow: hidden;\">There are three magic quote directives:<\/div>\n<div id=\"_mcePaste\" style=\"position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow: hidden;\">magic_quotes_gpc :- Affects HTTP Request data (GET, POST, and COOKIE). Cannot be set at runtime, and defaults to on in PHP.<\/div>\n<div id=\"_mcePaste\" style=\"position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow: hidden;\">magic_quotes_runtime:- If enabled, most functions that return data from an external source, including databases and text files, will have quotes escaped with a backslash. Can be set at runtime, and defaults to off in PHP.<\/div>\n<div id=\"_mcePaste\" style=\"position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow: hidden;\">magic_quotes_sybase :- If enabled, a single-quote is escaped with a single-quote instead of a backslash. If on, it completely overrides magic_quotes_gpc. Having both directives enabled means only single quotes are escaped as &#8221;. Double quotes, backslashes and NULL&#8217;s will remain untouched and unescaped.<\/div>\n<div id=\"_mcePaste\" style=\"position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow: hidden;\">Disabling the Magic Quotes :-<\/div>\n<div id=\"_mcePaste\" style=\"position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow: hidden;\">For disabling Magic quotes, we need to add the following to the php.ini file :-<\/div>\n<div id=\"_mcePaste\" style=\"position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow: hidden;\">&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<\/div>\n<div id=\"_mcePaste\" style=\"position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow: hidden;\">; Magic quotes for incoming GET\/POST\/Cookie data.<\/div>\n<div id=\"_mcePaste\" style=\"position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow: hidden;\">magic_quotes_gpc = Off<\/div>\n<div id=\"_mcePaste\" style=\"position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow: hidden;\">; Magic quotes for runtime-generated data, e.g. data from SQL, from exec(), etc.<\/div>\n<div id=\"_mcePaste\" style=\"position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow: hidden;\">magic_quotes_runtime = Off<\/div>\n<div id=\"_mcePaste\" style=\"position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow: hidden;\">; Use Sybase-style magic quotes (escape &#8216; with &#8221; instead of \\&#8217;).<\/div>\n<div id=\"_mcePaste\" style=\"position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow: hidden;\">magic_quotes_sybase = Off<\/div>\n<div id=\"_mcePaste\" style=\"position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow: hidden;\">&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<\/div>\n<div id=\"_mcePaste\" style=\"position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow: hidden;\">In case of shared hosting, we can make a custom php.ini in the home directory of the particular account. For example under the path :- \/home\/test\/public_html\/php.ini and provided the permissions of the user for the php.ini.<\/div>\n<p>Magic quotes is a module of php which was implemented in older versions of PHP. In latest versions, the module is depreciated. It is for the purpose of processing of escaping special characters with a &#8216;\\&#8217; to allow a string to be entered into a database.<\/p>\n<p>There are three magic quote directives:<\/p>\n<ul>\n<li><strong>magic_quotes_gpc<\/strong> :- Affects HTTP Request data (GET, POST, and COOKIE). Cannot be set at runtime, and defaults to on in PHP.<\/li>\n<li><strong> magic_quotes_runtime <\/strong>:- If enabled, most functions that return data from an external source, including databases and text files, will have quotes escaped with a backslash. Can be set at runtime, and defaults to off in PHP.<\/li>\n<li><strong>magic_quotes_sybase<\/strong> :- If enabled, a single-quote is escaped with a single-quote instead of a backslash. If on, it completely overrides magic_quotes_gpc. Having both directives enabled means only single quotes are escaped as &#8221;. Double quotes, backslashes and NULL&#8217;s will remain untouched and unescaped.<\/li>\n<\/ul>\n<p><strong>Disabling the Magic Quotes :-<\/strong><\/p>\n<p>For disabling Magic quotes, we need to add the following to the php.ini file :-<\/p>\n<blockquote><p>; Magic quotes for incoming GET\/POST\/Cookie data.<\/p>\n<p>magic_quotes_gpc = Off<\/p>\n<p>; Magic quotes for runtime-generated data, e.g. data from SQL, from exec(), etc.<\/p>\n<p>magic_quotes_runtime = Off<\/p>\n<p>; Use Sybase-style magic quotes (escape &#8216; with &#8221; instead of \\&#8217;).<\/p>\n<p>magic_quotes_sybase = Off<\/p><\/blockquote>\n<p>In case of shared hosting, we can make a custom php.ini in the home directory of the particular account. For example under the path :- \/home\/test\/public_html\/php.ini and provided the permissions of the user for the php.ini.<\/p>\n<div><\/div>\n<p>If you require help, c<a href=\"https:\/\/www.supportpro.com\/requestquote.php\">ontact SupportPRO Server Admin<\/a><\/p>\n<p style=\"text-align: center;\"><!--HubSpot Call-to-Action Code --><span id=\"hs-cta-wrapper-9d590242-d641-4383-94b4-8cfd62f0af6b\" class=\"hs-cta-wrapper\"><span id=\"hs-cta-9d590242-d641-4383-94b4-8cfd62f0af6b\" class=\"hs-cta-node hs-cta-9d590242-d641-4383-94b4-8cfd62f0af6b\"><!-- [if lte IE 8]><\/p>\n\n\n\n\n\n<div id=\"hs-cta-ie-element\"><\/div>\n\n\n<![endif]--><a href=\"https:\/\/cta-redirect.hubspot.com\/cta\/redirect\/2725694\/9d590242-d641-4383-94b4-8cfd62f0af6b\"><img decoding=\"async\" id=\"hs-cta-img-9d590242-d641-4383-94b4-8cfd62f0af6b\" class=\"hs-cta-img\" style=\"border-width: 0px;\" src=\"https:\/\/no-cache.hubspot.com\/cta\/default\/2725694\/9d590242-d641-4383-94b4-8cfd62f0af6b.png\" alt=\"Server not running properly? Get A FREE Server Checkup By Expert Server Admins - $125 Value\" \/><\/a><\/span><script charset=\"utf-8\" src=\"https:\/\/js.hscta.net\/cta\/current.js\"><\/script><script type=\"text\/javascript\"> hbspt.cta.load(2725694, '9d590242-d641-4383-94b4-8cfd62f0af6b', {}); <\/script><\/span><!-- end HubSpot Call-to-Action Code --><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Magic quotes is a module of php which was implemented in older versions of PHP. In latest versions, the module is depreciated. It is for the purpose of processing of&hellip;<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_lmt_disableupdate":"","_lmt_disable":"","footnotes":""},"categories":[1],"tags":[],"class_list":["post-760","post","type-post","status-publish","format-standard","hentry","category-miscellaneous"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/posts\/760","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/comments?post=760"}],"version-history":[{"count":3,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/posts\/760\/revisions"}],"predecessor-version":[{"id":3230,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/posts\/760\/revisions\/3230"}],"wp:attachment":[{"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/media?parent=760"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/categories?post=760"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/tags?post=760"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}