6.0.0-git
2021-01-18

[#9786] PHP ERROR: max(): When only one parameter is given, it must be an array
Summary PHP ERROR: max(): When only one parameter is given, it must be an array
Queue Ingo
Queue Version Git master
Type Bug
State Resolved
Priority 2. Medium
Owners jan (at) horde (dot) org
Requester vilius (at) lnk (dot) lt
Created 2011-04-03 (3578 days ago)
Due
Updated 2011-04-04 (3577 days ago)
Assigned 2011-04-03 (3578 days ago)
Resolved 2011-04-04 (3577 days ago)
Milestone
Patch Yes

History
2011-04-04 14:18:55 Jan Schneider Assigned to Jan Schneider
State ⇒ Resolved
 
2011-04-04 14:18:53 Git Commit Comment #7 Reply to this comment
Changes have been made in Git for this ticket:

Re-add lost is_array() checks (Bug #9786).

  20 files changed, 62 insertions(+), 30 deletions(-)
http://git.horde.org/horde-git/-/commit/cdbf3cb139b5b5508b51316852176c2fbbe23546
2011-04-04 14:18:50 Git Commit Comment #6 Reply to this comment
Changes have been made in Git for this ticket:

Don't cast to boolean, this can be arbitrary values (Bug #9786).

  1 files changed, 2 insertions(+), 2 deletions(-)
http://git.horde.org/horde-git/-/commit/1a8de0cc3622a84abc41ce71406cba74ebf6644b
2011-04-04 13:58:55 Jan Schneider Deleted Original Message
 
2011-04-03 14:21:56 vilius (at) lnk (dot) lt Comment #5 Reply to this comment
It's has an integer value of 64. The same value set for max_rules permission.
2011-04-03 14:13:14 Jan Schneider Comment #4 Reply to this comment
What is the value of $allowed when it's passed to 
Ingo_Application::hasPermission()? It seems to be a boolean but AFAICS 
it could only be false, and this case is catched earlier.
2011-04-03 14:03:19 vilius (at) lnk (dot) lt Comment #3 Reply to this comment
2011-04-03T17:02:28+03:00 WARN: HORDE [ingo] PHP ERROR: max(): When 
only one parameter is given, it must be an array [pid 19042 on line 
153 of "/var/www/html/horde/ingo/lib/Application.php"]
2011-04-03T17:02:28+03:00 DEBUG: 1. require() 
/var/www/html/horde/ingo/index.php:13
2. Horde_Core_Perms->hasAppPermission() 
/var/www/html/horde/ingo/filters.php:265
3. Horde_Registry->callAppMethod() /usr/share/pear/Horde/Core/Perms.php:284
4. call_user_func_array() /usr/share/pear/Horde/Registry.php:1059
5. Ingo_Application->hasPermission()
6. max() /var/www/html/horde/ingo/lib/Application.php:153
7. Horde::errorHandler()

2011-04-03T17:02:28+03:00 WARN: HORDE [ingo] PHP ERROR: array_filter() 
expects parameter 1 to be array, boolean given [pid 19042 on line 149 
of "/var/www/html/horde/ingo/lib/Application.php"]
2011-04-03T17:02:28+03:00 DEBUG: 1. require() 
/var/www/html/horde/ingo/index.php:13
2. Horde_Core_Perms->hasAppPermission() 
/var/www/html/horde/ingo/filters.php:320
3. Horde_Registry->callAppMethod() /usr/share/pear/Horde/Core/Perms.php:284
4. call_user_func_array() /usr/share/pear/Horde/Registry.php:1059
5. Ingo_Application->hasPermission()
6. array_filter() /var/www/html/horde/ingo/lib/Application.php:149
7. Horde::errorHandler()



2011-04-03 13:58:39 Jan Schneider Comment #2
State ⇒ Feedback
Reply to this comment
Can you provide a full error message, including a backtrace?
2011-04-03 13:21:03 vilius (at) lnk (dot) lt Comment #1
Type ⇒ Bug
State ⇒ Unconfirmed
Priority ⇒ 2. Medium
Summary ⇒ PHP ERROR: max(): When only one parameter is given, it must be an array
Queue ⇒ Ingo
Milestone ⇒
Patch ⇒ Yes
New Attachment: max.patch
Reply to this comment
When various permissions (max_events, max_rules) are set most 
applications throughs:

PHP ERROR: max(): When only one parameter is given, it must be an array

and do not allow any actions to be performed. I'm not sure if my patch 
fixes it correctly but at least Ingo works.

Saved Queries