Skip to content

fix: Use the global PEAR shim in Horde_Form_Action - #47

Merged
ralflang merged 1 commit into
horde:FRAMEWORK_6_1from
neuhaus:fix/use-global-pear-shim
Dec 5, 2026
Merged

ralflang merged 1 commit into
horde:FRAMEWORK_6_1from
neuhaus:fix/use-global-pear-shim

Conversation

@neuhaus

@neuhaus neuhaus commented Dec 5, 2026

Copy link
Copy Markdown
Contributor

lib/Horde/Form/Action.php imports Horde\Exception\PEAR and calls PEAR::raiseError().

Horde\Exception\PEAR (horde/exception src/PEAR.php) and Horde\Exception\Pear (src/Pear.php) are the same class name in PHP, which treats class names case-insensitively. If Horde\Exception\Pear was loaded first, PEAR::raiseError() here is undefined.

This removes the import, so the file (which has no namespace) uses the global PEAR class. horde/exception provides it through its compat/ classmap in all 3.x releases, so this works with current and future horde/exception versions.

horde/exception will rename its shim class to resolve the clash; see the companion PR there.

Horde\Exception\PEAR is the same class name as Horde\Exception\Pear
because PHP class names are case-insensitive, so PEAR::raiseError() here
fails when Horde\Exception\Pear was loaded first. The global PEAR class
from horde/exception's compat/ classmap (all 3.x releases) provides
raiseError() without that clash.
@neuhaus

neuhaus commented Dec 5, 2026

Copy link
Copy Markdown
Contributor Author

Companion PR in horde/exception: horde/Exception#7

@ralflang

ralflang commented Dec 5, 2026

Copy link
Copy Markdown
Member

Thank you for reporting. However it triggers the question: Where do you encounter pear errors / pear exceptions in production?

@ralflang
ralflang self-requested a review December 5, 2026 12:51
@neuhaus

neuhaus commented Dec 5, 2026

Copy link
Copy Markdown
Contributor Author

I encountered this issue while using Imap_Client. I fixed it in horde/Exception and then I looked for places that were affected.

@ralflang
ralflang merged commit d6cfda0 into horde:FRAMEWORK_6_1 Dec 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants