6.0.0-alpha14
7/2/25

[#13548] fatal error if in backend 'preferred' is an array
Summary fatal error if in backend 'preferred' is an array
Queue Ingo
Queue Version 3.2.1
Type Bug
State Resolved
Priority 1. Low
Owners mrubinsk (at) horde (dot) org, slusarz (at) horde (dot) org
Requester weis (at) kip (dot) uni-heidelberg (dot) de
Created 09/06/2014 (3952 days ago)
Due
Updated 11/03/2014 (3894 days ago)
Assigned
Resolved 09/08/2014 (3950 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch No

History
11/03/2014 04:46:32 AM Michael Slusarz Comment #7
Assigned to Michael Slusarz
Reply to this comment
Ingo 3.2.3
11/03/2014 04:46:27 AM Git Commit Comment #6 Reply to this comment
Changes have been made in Git (master):

commit 3fc53d075cf3a924d0b5892def1f4c111f5a5372
Author: Michael M Slusarz <slusarz@horde.org>
Date:   Sun Nov 2 21:45:04 2014 -0700

     [mms] Fix determination of preferred backend (Bug #13548).

     Conflicts:
             ingo/package.xml

  ingo/docs/CHANGES    |    7 +++++++
  ingo/lib/Session.php |    2 +-
  ingo/package.xml     |   14 +++++++++++++-
  3 files changed, 21 insertions(+), 2 deletions(-)

http://github.com/horde/horde/commit/3fc53d075cf3a924d0b5892def1f4c111f5a5372
11/03/2014 04:45:16 AM Git Commit Comment #5 Reply to this comment
Changes have been made in Git (FRAMEWORK_5_2):

commit 72b1da6b950c6c1b49e498c087f61286c9fd3f5a
Author: Michael M Slusarz <slusarz@horde.org>
Date:   Sun Nov 2 21:45:04 2014 -0700

     [mms] Fix determination of preferred backend (Bug #13548).

  ingo/docs/CHANGES    |    1 +
  ingo/lib/Session.php |    2 +-
  ingo/package.xml     |    4 ++--
  3 files changed, 4 insertions(+), 3 deletions(-)

http://github.com/horde/horde/commit/72b1da6b950c6c1b49e498c087f61286c9fd3f5a
11/02/2014 10:32:48 PM ricardo (at) wenn (dot) com Comment #4
New Attachment: ingo.patch Download
Reply to this comment
These changes still do not work.

$backend = $v;

should be

$backend = $val;

Find attached patch.
09/08/2014 01:52:00 PM Michael Rubinsky Assigned to Michael Rubinsky
State ⇒ Resolved
 
09/08/2014 01:47:50 PM Git Commit Comment #3 Reply to this comment
Changes have been made in Git (FRAMEWORK_5_2):

commit 5c840a6cab3bca396b3ed0cd964fbdb9450937ed
Author: Michael J Rubinsky <mrubinsk@horde.org>
Date:   Mon Sep 8 09:44:58 2014 -0400

     Bug: 13548  Fix variable name in for loop.

  ingo/lib/Session.php |    8 ++++----
  1 files changed, 4 insertions(+), 4 deletions(-)

http://github.com/horde/horde/commit/5c840a6cab3bca396b3ed0cd964fbdb9450937ed
09/08/2014 01:45:37 PM Git Commit Comment #2 Reply to this comment
Changes have been made in Git (master):

commit 2889fe664050b58460dbe4279cd7f0f8c829fde4
Author: Michael J Rubinsky <mrubinsk@horde.org>
Date:   Mon Sep 8 09:44:58 2014 -0400

     Bug: 13548  Fix variable name in for loop.

  ingo/lib/Session.php |    8 ++++----
  1 files changed, 4 insertions(+), 4 deletions(-)

http://github.com/horde/horde/commit/2889fe664050b58460dbe4279cd7f0f8c829fde4
09/06/2014 06:27:37 PM weis (at) kip (dot) uni-heidelberg (dot) de Comment #1
Priority ⇒ 1. Low
Type ⇒ Bug
Summary ⇒ fatal error if in backend 'preferred' is an array
Queue ⇒ Ingo
Milestone ⇒
Patch ⇒ No
State ⇒ Unconfirmed
Reply to this comment
After upgrade to the newest version, ingo (and imp) crashed with a fatal error
   No "script" element found in backend configuration.

In the backend definition of ingo 'script' was defined.
The error traced back to
    _getBackend() ....ingo/lib/Session.php:47
where I found the reason:

In file  ingo/lib/Session.php (line 126):
                    foreach ($val['preferred'] as $val) {
                         if (($val == $_SERVER['SERVER_NAME']) ||
                             ($val == $_SERVER['HTTP_HOST'])) {
                             $backend = $val;
                         }
                     }

This code is only used, if  'preferred' in the backend definition is an array.
$val is used in two meanings and the 'foreach' overwrites the first one.
It should be more like this:

                    foreach ($val['preferred'] as $v) {
                         if (($v == $_SERVER['SERVER_NAME']) ||
                             ($v == $_SERVER['HTTP_HOST'])) {
                             $backend = $v;
                         }
                     }

sorry, don't know how make a patch for this

Saved Queries