本文整理汇总了PHP中XenForo_Application::undoMagicQuotes方法的典型用法代码示例。如果您正苦于以下问题:PHP XenForo_Application::undoMagicQuotes方法的具体用法?PHP XenForo_Application::undoMagicQuotes怎么用?PHP XenForo_Application::undoMagicQuotes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XenForo_Application
的用法示例。
在下文中一共展示了XenForo_Application::undoMagicQuotes方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: parseQueryString
/**
* Parses a query string (x=y&a=b&c[]=d) into a structured array format.
*
* @param string $string
*
* @return array
*/
public static function parseQueryString($string)
{
parse_str($string, $output);
if (function_exists('get_magic_quotes_gpc') && get_magic_quotes_gpc()) {
XenForo_Application::undoMagicQuotes($output);
}
return $output;
}
示例2: parseQueryString
/**
* Parses a query string (x=y&a=b&c[]=d) into a structured array format.
*
* Note that this can handle very long query strings, but it has problems
* if there are conflicting elements that split the "chunks" that are made
* internally. Workaround this using distinct keys for each input whenever possible.
*
* @param string $string
*
* @return array
*/
public static function parseQueryString($string)
{
$max = intval(@ini_get('max_input_vars'));
if ($max && substr_count($string, '&') >= $max) {
$string = preg_replace_callback('/(?<=^|&)([^=&]+)(\\[\\]|%5B%5D)/U', array('XenForo_Application', 'parseQueryStringCallback'), $string);
self::$_qsPartCounter = array();
$chunks = array_chunk(explode('&', $string), $max, true);
$output = array();
foreach ($chunks as $chunk) {
parse_str(implode('&', $chunk), $values);
$output = self::mapMerge($output, $values);
}
} else {
parse_str($string, $output);
}
if (function_exists('get_magic_quotes_gpc') && get_magic_quotes_gpc()) {
XenForo_Application::undoMagicQuotes($output);
}
return $output;
}