Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
External Libraries: Skip instanceof check when null in Text_Diff::_ch…
…eck(). On the first `foreach` loop in Text_Diff::_check()`, `$prevtype` is `null`. As `instanceof` requires the class name term to be an object or string, a fatal error is thrown: >Fatal error: Uncaught Error: Class name must be a valid object or a string on line 279 This change: * Adds a simple test for the `Text_Diff::_check()` method, which is how the bug was discovered as the test could never pass with the code as-is. * Adds a defensive guard to protect against the fatal. It checks if `$prevtype` is not `null` as a pre-condition to for checking the instance. This bugfix also resolves the failing test. Follow-up to [49194], [7747]. Props jrf, hellofromTonya. See #62083. git-svn-id: https://develop.svn.wordpress.org/trunk@59070 602fd350-edb4-49c9-b593-d223f7449a82
- Loading branch information