wpseek.com
WordPress开发者和主题制作者的搜索引擎



add_magic_quotes › WordPress Function

Since0.71
已弃用n/a
add_magic_quotes ( $input_array )
参数:
  • (array) $input_array Array to walk while sanitizing contents.
    Required: Yes
返回:
  • (array) Sanitized $input_array.
定义在:
文档:
Change Log:
  • 5.5.0

Walks the array while sanitizing the contents.



源码

function add_magic_quotes( $input_array ) {
	foreach ( (array) $input_array as $k => $v ) {
		if ( is_array( $v ) ) {
			$input_array[ $k ] = add_magic_quotes( $v );
		} elseif ( is_string( $v ) ) {
			$input_array[ $k ] = addslashes( $v );
		}
	}

	return $input_array;
}