Escape user-passed variables, from ecshop

Source: Internet
Author: User
Tags smarty template

Escape user-passed variables from ecshop.

/* Escape the input variables. */If (! Get_magic_quotes_gpc () {if (! Empty ($ _ GET) {$ _ GET = addslashes_deep ($ _ GET);} if (! Empty ($ _ POST) {$ _ POST = addslashes_deep ($ _ POST);} $ _ COOKIE = addslashes_deep ($ _ COOKIE ); $ _ REQUEST = addslashes_deep ($ _ REQUEST);}/* escape special characters in the variable in recursive mode */function addslashes_deep ($ value) {return empty ($ value )? $ Value: is_array ($ value )? Array_map ('addslashes _ deep ', $ value): addslashes ($ value );}
Articles you may be interested in
  • How PHP serializes variables is better than php's four serialization Methods
  • Jump to the corresponding Email homepage Based on the Email entered by the user
  • How to check MySQL startup time and running time
  • Image zoom-in display special effects slimbox the most lightweight function the most powerful Jquery Image zoom-in special effects
  • Powerful PHP image processing class (watermark, transparency, zoom, sharpen, rotate, flip, cut, reversed)
  • Use php functions in the smarty template and how to use multiple functions for a variable in the smarty Template
  • Use the GZip compression function of PHP to compress website JS and CSS files to accelerate Website access.
  • How does php determine whether the current operating system is linux or windows?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.