[Tickets #14868] text_diff_renderer_inline calls itself, making subclassing impossible

[email protected]
Newsgroups gmane.comp.horde.bugs
Message-ID <[email protected]>
DO NOT REPLY TO THIS MESSAGE. THIS EMAIL ADDRESS IS NOT MONITORED.

Ticket URL: https://bugs.horde.org/ticket/14868
------------------------------------------------------------------------------
  Ticket             | 14868
  Created By         | [email protected]
  Summary            | text_diff_renderer_inline calls itself, making
                     | subclassing impossible
  Queue              | Horde Framework Packages
  Type               | Bug
  State              | Unconfirmed
  Priority           | 1. Low
  Milestone          |
  Patch              | 1
  Owners             |
------------------------------------------------------------------------------


[email protected] (2018-10-23 09:40) wrote:

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



-- 
bugs mailing list
Frequently Asked Questions: http://wiki.horde.org/FAQ
To unsubscribe, mail: [email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.