Ticket #2223 (closed defect: fixed)
[] operator not supported for strings
Reported by: | triaxx | Owned by: | team |
---|---|---|---|
Priority: | normal | Milestone: | 2.11 |
Component: | module:core | Version: | 2.10.4 |
Severity: | normal | Keywords: | |
Cc: |
Description
I am using php-7.1.0rc2. The following exception is thrown and bills cannot be edited:
Nov 21 13:58:14 dotclear: 2016/11/21 13:58:14 [error] 6327#0: *30417 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught Error: [] operator not supported for strings in /dotclear/inc/core/class.dc.postmedia.php:61 Stack trace: #0 /dotclear/inc/core/class.dc.media.php(597): dcPostMedia->getPostMedia(Array) #1 /dotclear/plugins/attachments/_admin.php(48): dcMedia->getPostMedia('14', NULL, 'attachment') #2 /dotclear/inc/core/class.dc.core.php(399): attachmentAdmin::adminPostFormItems(Object(ArrayObject), Object(ArrayObject), Object(record)) /dotclear/admin/post.php(590): dcCore->callBehavior('adminPostFormIt...', Object(ArrayObject), Object(ArrayObject), Object(record)) #4 {main} thrown in /dotclear/inc/core/class.dc.postmedia.php on line 61" while reading upstream, client: 46.218.45.195, server: blog.triaxx.org, request: "GET /admin/post.php?id=14 HTTP/1.1", upstream: "fastcgi://unix:/var/run/php-fpm.sock:", host: "blog.example.net", referrer: "https://blog.example.net/admin/posts.php"
The problem can be easily resolved with just one change:
diff -ru dotclear.old/inc/core/class.dc.postmedia.php dotclear/inc/core/class.dc.postmedia.php --- dotclear.old/inc/core/class.dc.postmedia.php 2016-11-21 14:41:21.000000000 +0100 +++ dotclear/inc/core/class.dc.postmedia.php 2016-11-21 14:42:07.000000000 +0100 @@ -56,7 +56,7 @@ $strReq .= $params['from'].' '; } - $where=''; + $where=[]; if (isset($params['post_id'])) { $where[]="PM.post_id ".$this->con->in($params['post_id']); }
Change History
Note: See
TracTickets for help on using
tickets.
(In [ee26086333f1]) Typo, fixes #2223, thank’s triaxx for patch ;-)