PHP Parse Error
In the process of updating to piler. Background information:
Debian 9.13
Piler 1.3.11
Compiled piler but now the website gives a HTTP Error 500 when trying to access it. The only message in the logs I can find is “PHP Parse error: syntax error, unexpected '=' in (path redacted)/search.php on line 734”. If I comment this line and the next that mentions wildcards in search.php I can get the site to load but no results are returned when searching.
Did I miss something?
Comments (7)
-
repo owner -
reporter Started with php7, then installed 8 to see if that works. Same error, but still on 8.
search.php 730-739:
else { if(Registry::get('auditor_user') == 1 && RESTRICTED_AUDITOR == 1) { $query = $this->db->query("SELECT id FROM " . VIEW_MESSAGES . " WHERE id=? AND ( `fromdomain` IN ($q) OR `todomain` IN ($q) )", $arr); } else { [$arr, $query_suffix] = $this->get_wildcard_domains($arr); $query = $this->db->query("SELECT id FROM " . VIEW_MESSAGES . " WHERE id=? AND ( `from` IN ($q) OR `to` IN ($q) $query_suffix )", $arr); } if(isset($query->row['id'])) { return 1; }
If I comment 734 out, I get the same error except on line 814. Here’s the code from 807-817:
$query = $this->db->query("SELECT id FROM " . TABLE_PRIVATE . " WHERE `id` IN ($q2)", $id); if($query->num_rows > 0) { foreach ($query->rows as $r) { array_push($parr, $r['id']); } } [$arr, $query_suffix] = $this->get_wildcard_domains($arr); $query = $this->db->query("SELECT id FROM `" . VIEW_MESSAGES . "` WHERE `id` IN ($q2) AND ( `from` IN ($q) OR `to` IN ($q) $query_suffix)", $arr); } } }
Commenting that last one out gives the webui, but any searches return empty.
-
repo owner I can’t reproduce the issue with php 7.4.3.
-
reporter I’m attempting to upgrade. It was on 1.3.5 and I downloaded 1.3.11. Is there anything in the web code that might be different? Something I might need to copy again?
-
repo owner Try copying the whole webui directory from 1.3.11 source tree.
-
reporter Same thing. I even switch back to php7.
-
repo owner - changed status to wontfix
Then try the following and rewrite the 2 problematic codes, eg.
list($arr, $query_suffix) = $this->get_wildcard_domains($arr);
Since I couldn't reproduce the issue, and noone has reported except you, I won't fix it.
- Log in to comment
What php version do you have? Also show me the code from this file between 730-739 lines. Be sure to format it!