6.0.0-beta1
7/8/25

[#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 04/03/2011 (5210 days ago)
Due
Updated 04/04/2011 (5209 days ago)
Assigned 04/03/2011 (5210 days ago)
Resolved 04/04/2011 (5209 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch Yes

History
04/04/2011 02:18:55 PM Jan Schneider Assigned to Jan Schneider
State ⇒ Resolved
 
04/04/2011 02:18:53 PM 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
04/04/2011 02:18:50 PM 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
04/04/2011 01:58:55 PM Jan Schneider Deleted Original Message
 
04/03/2011 02:21:56 PM 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.
04/03/2011 02:13:14 PM 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.
04/03/2011 02:03:19 PM 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()



04/03/2011 01:58:39 PM Jan Schneider Comment #2
State ⇒ Feedback
Reply to this comment
Can you provide a full error message, including a backtrace?
04/03/2011 01:21:03 PM vilius (at) lnk (dot) lt Comment #1
Priority ⇒ 2. Medium
Type ⇒ Bug
Summary ⇒ PHP ERROR: max(): When only one parameter is given, it must be an array
Queue ⇒ Ingo
Milestone ⇒
Patch ⇒ Yes
New Attachment: max.patch
State ⇒ Unconfirmed
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