1

我正在使用 CakePHP 2.x 和 PHP 5.4,但出现以下错误:

Strict (2048): Only variables should be passed by reference [APP/Controller/Component/AttachmentComponent.php, line 106]
Strict (2048): Only variables should be passed by reference [APP/Controller/Component/AttachmentComponent.php, line 169]
Strict (2048): Only variables should be passed by reference [APP/Controller/Component/AttachmentComponent.php, line 169]

https://github.com/tute/Thumbnail-component-for-CakePHP/tree/cake2

使用 php 5.3 一切正常。我怎样才能解决这个问题?

4

1 回答 1

3
$file_name = end(split($ds, $tmpfile));

应该

$parts = split($ds, $tmpfile);
$file_name = end($parts);

您可以在组件中修复它并向原作者提交 PR

于 2012-09-25T14:39:32.263 回答