我想加密在CakePHP中傳遞的URL。我跟着這篇文章(http://bakery.cakephp.org/articles/yuri.salame/2008/07/15/encrypting-urls#),它不起作用。我知道這是一篇舊文章。我使用CakePHP的2.x的CakePHP加密URL
這裏顯示的錯誤:
Notice (8): Undefined index: url [APP/webroot/index.php, line 108]
Warning (4096): Argument 1 passed to Dispatcher::dispatch() must be an instance of CakeRequest, null given, called in /home/xxx/domains/xxx.com/public_html/xxx/v3/app/webroot/index.php on line 110 and defined [CORE/Cake/Routing/Dispatcher.php, line 140]
Warning (4096): Argument 2 passed to Dispatcher::dispatch() must be an instance of CakeResponse, none given, called in /home/xxx/domains/xxx.com/public_html/xxx/v3/app/webroot/index.php on line 110 and defined [CORE/Cake/Routing/Dispatcher.php, line 140]
Notice (8): Trying to get property of non-object [CORE/Cake/Routing/Filter/AssetDispatcher.php, line 45]
我應用程序/ Web根目錄/的index.php是(我只顯示最後一個部分):
App::uses('Dispatcher', 'Routing');
$url = do_decrypt($_REQUEST["url"]);
$Dispatcher = new Dispatcher();
$Dispatcher->dispatch($url);
$Dispatcher = new Dispatcher();
$Dispatcher->dispatch(
new CakeRequest(),
new CakeResponse()
);
加密在哪裏?您鏈接的文章僅將URL編碼爲base64,而不是加密系統。 Base64與安全無關。 –