2011-10-15 20 views
0

當值包含字符+(加號)時,這是命名參數值的問題。CakePHP plus將命名參數解碼爲空間

URL是http://localhost/kidwatcher/messages/sentbox/number:+6581235251237

當我嘗試var_dump命名paramater(在這種情況下是number),字符+變成了空間。

string(14) " 6581235251237" 

性格+%2B,結果是相同的,當我改變網址:

http://localhost/kidwatcher/messages/sentbox/number:%2B6581235251237 

string(14) " 6581235251237" 

但是當我使用URL查詢字符串,它的工作原理。

http://localhost/kidwatcher/messages/sentbox?number=%2B6581235251237 

string(14) "+6581235251237" 

命名參數有什麼問題?

回答

1

好吧,現在我已經解決了這個問題。

在文件夾中的應用程序/根目錄

編輯htaccess來

<IfModule mod_rewrite.c> 
RewriteEngine On 
RewriteCond %{REQUEST_FILENAME} !-d 
    RewriteCond %{REQUEST_FILENAME} !-f 
    RewriteRule ^(.*)$ index.php?url=$1 [QSA,L,B] 
</IfModule>