0

我正在将一个站点迁移到 cakephp v2.0。在某些时候,我使用带有希腊字符的链接:

contents/library/category:κατηγορία

如果我 pr() 或 debug() $this->request->named['category'] 输出显示为 %CE%88%CE%BD%CF%84%CF%85%CF%80%CE% B1%20%CE%94。

并且因为它被传递给查找查询,所以它不返回任何数据。在 v1.3 中,字符没有被转义。有什么改变吗?我什至尝试过 debug($var,false); 但同样的事情也会发生。

4

1 回答 1

0

When you're creating your URL via the HTMLHelper or accepting them from FormHelper they are automatically escaped now to prevent malicious URL manipulation; non-latin characters are escaped as are all non-(latin)alphanumeric characters. To avoid this set 'escape' to false in the options array, like the below example from the CakePHP 2.0 book:

echo $this->Html->link(
    $this->Html->image("recipes/6.jpg", array("alt" => "Brownies")),
    "recipes/view/6",
    array('escape' => false)
);
于 2011-10-26T14:41:31.330 回答