6.0.0-alpha12
6/12/25

[#11913] Horde_Mime use preg_replace with eval
Summary Horde_Mime use preg_replace with eval
Queue Components
Type Enhancement
State Duplicate
Priority 1. Low
Owners
Requester remi (at) famillecollet (dot) com
Created 12/21/2012 (4556 days ago)
Due
Updated 01/15/2013 (4531 days ago)
Assigned
Resolved 01/15/2013 (4531 days ago)
Milestone
Patch No

History
01/15/2013 03:12:56 PM Jan Schneider Comment #2
State ⇒ Duplicate
Patch ⇒ No
Reply to this comment
12/21/2012 03:39:01 PM remi (at) famillecollet (dot) com Comment #1
Priority ⇒ 1. Low
New Attachment: Horde_Mime_php55.patch Download
Patch ⇒ Yes
Milestone ⇒
Queue ⇒ Components
Summary ⇒ Horde_Mime use preg_replace with eval
Type ⇒ Enhancement
State ⇒ New
Reply to this comment
Mime.php uses preg_replace with /e modifier (PREG_REPLACE_EVAL)

From PHP documentation :
"Use of this modifier is discouraged, as it can easily introduce 
security vulnerabilite"
"This feature has been DEPRECATED as of PHP 5.5.0. Relying on this 
feature is highly discouraged"

So with PHP 5.5, Horde_Imap_Client test suite fails with
preg_replace(): The /e modifier is deprecated, use 
preg_replace_callback instead

The attached patch use preg_replace_callback instead, with an 
anonymous function (supported since php 5.3.0).

I understand than php 5.5 is not yet supported, but as this fix 
doesn't change the requirement and is still compatible with previous 
php version, I hope you will consider it.

Saved Queries