jbowens / jBBCode

A lightweight but extensible BBCode parser
http://jbbcode.com
MIT License
164 stars 32 forks source link

use strict comparison when searching for a node's child #86

Closed alexmichelet closed 4 years ago

alexmichelet commented 4 years ago

The loose comparison used to find the child to remove from a node will compare every attributes recursively, which can lead to recursion errors ("nesting level too deep") and poor performance when you're dealing with a lot of nested nodes.

A strict comparison makes sure that it's the same instance, which should be enough. see : https://www.php.net/manual/en/language.oop5.object-comparison.php

Kubo2 commented 4 years ago

@jbowens All tests pass. I am not sure why Travis did not run on this one.

jbowens commented 4 years ago

Thanks! Looks good to me

alexmichelet commented 4 years ago

Thank you! @jbowens is it possible to release a new patch version with this change ?

jbowens commented 4 years ago

@alexmichelet for sure. released 1.4.2 with this change