РЕДАКТИРОВАТЬ
Это то, что я сделал именно так, насколько я мог понять с помощью мои небольшие знания из ссылки на этот ответ. здесь
Код: Выделить всё
function wp_magic_quotes() {
// If already slashed, strip.
if ( get_magic_quotes_gpc() ) {
$_GET = stripslashes_deep( $_GET );
$_POST = stripslashes_deep( $_POST );
$_COOKIE = stripslashes_deep( $_COOKIE );
}
// Escape with wpdb.
$_GET = add_magic_quotes( $_GET );
$_POST = add_magic_quotes( $_POST );
// $_COOKIE = add_magic_quotes( $_COOKIE );
array_walk($_COOKIE, 'ci_ignore_magic_quotes');
$_SERVER = add_magic_quotes( $_SERVER );
// Force REQUEST to be GET + POST.
$_REQUEST = array_merge( $_GET, $_POST );
}
/** added by me
* Applies Magic Quotes to the $_COOKIE global but ignores Codeigniter's
Cookie
* @param string $value Value passed by array_walk function
* @param string $key Key passed by array_walk function
*/
function ci_ignore_magic_quotes($value,$key)
{
if($key != "ci_session")
{
stripslashes_deep($value);
}
}
Код: Выделить всё
public function index()
{
print_r($_SESSION);exit;
$this->load->view('welcome_message');
}
Код: Выделить всё
Array ( [__ci_last_regenerate] => 1504085777 )
Я пытаюсь интегрировать эти wp и ci в первый раз. Поэтому, пожалуйста, помогите, чем можете. Спасибо.
Подробнее здесь: https://stackoverflow.com/questions/459 ... odeigniter