6.0.0-alpha10
5/14/25

[#14868] text_diff_renderer_inline calls itself, making subclassing impossible
Summary text_diff_renderer_inline calls itself, making subclassing impossible
Queue Horde Framework Packages
Type Bug
State Unconfirmed
Priority 1. Low
Owners
Requester mrten_horde (at) ii (dot) nl
Created 10/23/2018 (2395 days ago)
Due
Updated 10/23/2018 (2395 days ago)
Assigned
Resolved
Milestone
Patch Yes

History
10/23/2018 09:40:54 AM mrten_horde (at) ii (dot) nl Comment #1
State ⇒ Unconfirmed
Priority ⇒ 1. Low
Type ⇒ Bug
Summary ⇒ text_diff_renderer_inline calls itself, making subclassing impossible
Queue ⇒ Horde Framework Packages
Milestone ⇒
Patch ⇒ Yes
Reply to this comment
If you want to use another _encode function in a subclass of 
Horde_Text_Diff_Renderer_Inline you can subclass it. But on line ~160 
the class makes a new instantiation of itself, thereby nullifying the 
original subclass.

Small patch:

@@ -158,7 +158,8 @@
          }

          /* Get the diff in inline format. */
-        $renderer = new Horde_Text_Diff_Renderer_inline
+        $class = static::class;
+        $renderer = new $class

Saved Queries