打zZ~瞌睡 Menu

All items for September, 2016

关于闭包最牛B的解释

引用:http://www.cnblogs.com/xiaotie/archive/2011/08/03/2126145.html

Your host needs to disable magic_quotes_gpc to run this version of Joomla!

直接修改php.ini和通过.htaccess的修改方法就不说了,万网的主机是不允许自行修改php.ini的参数的。以下是通过代码修改,不过注意,这样修改:

  1. 可能会有风险
  2. 会增加Joomla升级的维护成本

找到libraries/joomla/filter/input.php

public function clean($source, $type = 'string')
{
   // Handle the type constraint
   switch (strtoupper($type))
   {...
   }
   // -- ADD THIS CODE HERE
   // Handle magic quotes compatibility
   if(get_magic_quotes_gpc()) $result = self::_stripSlashesRecursive($result);
}

在文件775行左右添加

/**
 * Strips slashes recursively on an array.
 *
 * @param   array  $value  Array or (nested arrays) of strings.
 *
 * @return  array  The input array with stripslashes applied to it.
 *
 * @deprecated  12.1 - Sanctioned on 2012-10-09 thanks to Anton Wintergerst
 * @since       11.1
 */
protected static function _stripSlashesRecursive($value)
{
    $value = is_array($value) ? array_map(array('JFilterInput', '_stripSlashesRecursive'), $value) : stripslashes($value);
    return $value;
}