Browscap is throwing these errors when it updates the database with browser info.

Drupal 5.2.
MySQL database 5.0.24a
PHP 5.2.3
Apache 1.3.37

    * warning: array_merge() [function.array-merge]: Argument #1 is not an array in /home/path-to-drupalsites/all/modules/browscap/browscap.module on line 328.
    * warning: array_change_key_case() [function.array-change-key-case]: The argument should be an array in /home/path-to-drupal/sites/all/modules/browscap/browscap.module on line 332.
    * warning: array_merge() [function.array-merge]: Argument #1 is not an array in /home/path-to-drupal/sites/all/modules/browscap/browscap.module on line 328.
    * warning: array_change_key_case() [function.array-change-key-case]: The argument should be an array in /home/path-to-drupal/sites/all/modules/browscap/browscap.module on line 332.
    * warning: array_merge() [function.array-merge]: Argument #1 is not an array in /home/path-to-drupal/sites/all/modules/browscap/browscap.module on line 328.
    * warning: array_change_key_case() [function.array-change-key-case]: The argument should be an array in /home/path-to-drupal/sites/all/modules/browscap/browscap.module on line 332.
    * warning: array_merge() [function.array-merge]: Argument #1 is not an array in /home/path-to-drupal/sites/all/modules/browscap/browscap.module on line 328.
    * warning: array_change_key_case() [function.array-change-key-case]: The argument should be an array in /home/path-to-drupal/sites/all/modules/browscap/browscap.module on line 332.
    * warning: array_merge() [function.array-merge]: Argument #1 is not an array in /home/path-to-drupal/sites/all/modules/browscap/browscap.module on line 328.
    * warning: array_change_key_case() [function.array-change-key-case]: The argument should be an array in /home/path-to-drupal/sites/all/modules/browscap/browscap.module on line 332.
    * warning: array_merge() [function.array-merge]: Argument #1 is not an array in /home/path-to-drupal/sites/all/modules/browscap/browscap.module on line 328.
    * warning: array_change_key_case() [function.array-change-key-case]: The argument should be an array in /home/path-to-drupal/sites/all/modules/browscap/browscap.module on line 332.
    * warning: array_merge() [function.array-merge]: Argument #1 is not an array in /home/path-to-drupal/sites/all/modules/browscap/browscap.module on line 328.
    * warning: array_change_key_case() [function.array-change-key-case]: The argument should be an array in /home/path-to-drupal/sites/all/modules/browscap/browscap.module on line 332.
    * warning: array_merge() [function.array-merge]: Argument #1 is not an array in /home/path-to-drupal/sites/all/modules/browscap/browscap.module on line 328.
    * warning: array_change_key_case() [function.array-change-key-case]: The argument should be an array in /home/path-to-drupal/sites/all/modules/browscap/browscap.module on line 332.
    * warning: array_merge() [function.array-merge]: Argument #1 is not an array in /home/path-to-drupal/sites/all/modules/browscap/browscap.module on line 328.
    * warning: array_change_key_case() [function.array-change-key-case]: The argument should be an array in /home/path-to-drupal/sites/all/modules/browscap/browscap.module on line 332.
    * warning: array_merge() [function.array-merge]: Argument #1 is not an array in /home/path-to-drupal/sites/all/modules/browscap/browscap.module on line 328.
    * warning: array_change_key_case() [function.array-change-key-case]: The argument should be an array in /home/path-to-drupal/sites/all/modules/browscap/browscap.module on line 332.
CommentFileSizeAuthor
#1 browscap.module.patch499 bytesBodo Maass

Comments

Bodo Maass’s picture

Status: Active » Needs review
StatusFileSize
new499 bytes

This is because the array merge function has changed in PHP5. To fix this, change line 328 of browscap.module into this:
$e = array_merge((array)$vals, (array)$e);

Patch is attached.

robloach’s picture

I fixed this in the Drupal 6 branch by forcing a check on the values with isset. Is casting to an array when the values could be invalid or empty sane? Well, I'll commit this, and if you want to back port the fix I used in the Drupal 6 branch, a patch would be great!

robloach’s picture

Status: Needs review » Patch (to be ported)
mikeryan’s picture

Status: Patch (to be ported) » Fixed

Looks like it was backported into the Drupal 5 branch, thanks!

robloach’s picture

Hmm, strange... I don't remember committing it. Must've been late.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.