database.php中的Kohana preg_replace错误

ErrorException [ 8192 ]: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead on http://mastersoftwaretechnologies.com/kohana/index.php/user/login

Looks like you are using php 5.5. If you want to use preg replace eval with it you have to modify it firts because it is deprecated due to security reasons: http://php.net/manual/en/migration55.deprecated.php

With php 5.5 you should use preg_replace_callback()

Good example you will find here: Replace deprecated preg_replace /e with preg_replace_callback

And info how it works here: Replace preg_replace() e modifier with preg_replace_callback

Just modify second paremeter accordingly to that what you want to do with matches.

This works in my kohana-3.2

Replace

$column = preg_replace('/"(.+?)"/e', '$this->quote_column("$1")', $column);

to

$column = preg_replace_callback('/"(.+?)"/', function($m) { return $this->quote_column($m[1]); }, $column);

In the file MODPATH/database/classes/kohana/database.php line 525