Skip to content

bug(turba): addressbook edit issue with addcslashes #38

@ralflang

Description

@ralflang

Error report with potential fix from the mailing list

I'm sure they will be issuing a proper fix. If you need this to work NOW, then you can quote the $var item on that line.

Before: (line 1284 of /vendor/horde/core/src/Horde.php

$options['params'][$key] = addcslashes($val, '"');

After:

$options['params'][$key] = addcslashes('$val', '"');

Hi,

I am getting following error when I am clicking on editing the address book. I can add users and edit users, but not the address book.

A fatal error has occurred

addcslashes(): Argument #1 ($string) must be of type string, true given

in /opt/local/www/apache2/horde/vendor/horde/core/src/Horde.php:1284

  1. require_once() /opt/local/www/apache2/horde/web/turba/addressbooks/edit.php:3
  2. Turba_Form_EditAddressBook->__construct() /opt/local/www/apache2/horde/vendor/horde/turba/addressbooks/edit.php:36
  3. Horde::popupJs() /opt/local/www/apache2/horde/vendor/horde/turba/lib/Form/EditAddressBook.php:154
  4. Horde\Core\Horde::popupJs() /opt/local/www/apache2/horde/vendor/horde/core/lib/Horde.php:932
  5. addcslashes() /opt/local/www/apache2/horde/vendor/horde/core/src/Horde.php:1284

Details

The full error message is logged in Horde's log file, and is shown below only to administrators. Non-administrative users will not see error details.

TypeError Object
(
[message:protected] => addcslashes(): Argument #1 ($string) must be of type string, true given
[string:Error:private] => TypeError: addcslashes(): Argument #1 ($string) must be of type string, true given in /opt/local/www/apache2/horde/vendor/horde/core/src/Horde.php:1284
Stack trace:
#0 /opt/local/www/apache2/horde/vendor/horde/core/src/Horde.php(1284): addcslashes()
#1 /opt/local/www/apache2/horde/vendor/horde/core/lib/Horde.php(932): Horde\Core\Horde::popupJs()
#2 /opt/local/www/apache2/horde/vendor/horde/turba/lib/Form/EditAddressBook.php(154): Horde::popupJs()
#3 /opt/local/www/apache2/horde/vendor/horde/turba/addressbooks/edit.php(36): Turba_Form_EditAddressBook->__construct()
#4 /opt/local/www/apache2/horde/web/turba/addressbooks/edit.php(3): require_once('...')
#5 {main}
[code:protected] => 0
[file:protected] => /opt/local/www/apache2/horde/vendor/horde/core/src/Horde.php
[line:protected] => 1284
[trace:Error:private] => Array
(
[0] => Array
(
[file] => /opt/local/www/apache2/horde/vendor/horde/core/src/Horde.php
[line] => 1284
[function] => addcslashes
)

       [1] => Array
           (
               [file] => /opt/local/www/apache2/horde/vendor/horde/core/lib/Horde.php
               [line] => 932
               [function] => popupJs
               [class] => Horde\Core\Horde
               [type] => ::
           )

       [2] => Array
           (
               [file] => /opt/local/www/apache2/horde/vendor/horde/turba/lib/Form/EditAddressBook.php
               [line] => 154
               [function] => popupJs
               [class] => Horde
               [type] => ::
           )

       [3] => Array
           (
               [file] => /opt/local/www/apache2/horde/vendor/horde/turba/addressbooks/edit.php
               [line] => 36
               [function] => __construct
               [class] => Turba_Form_EditAddressBook
               [type] => ->
           )

       [4] => Array
           (
               [file] => /opt/local/www/apache2/horde/web/turba/addressbooks/edit.php
               [line] => 3
               [args] => Array
                   (
                       [0] => /opt/local/www/apache2/horde/vendor/horde/turba/addressbooks/edit.php
                   )

               [function] => require_once
           )

   )

[previous:Error:private] =>
)

Horde mailing list

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions