Instead of checking if the resulting $matches array is complete, we can safely assume it is, as long as the preg_match() call returned a non-false value. Note that some of these used empty() before and are actually bogus because of this! empty() considers the string "0" to be empty. In case of a ==0== headline that's an actual bug. I'm also removing the `= []` initialization before the preg_match. I understand why it was added: to make it a little more obvious that the variable is guaranteed to be initialized. But: * This is guaranteed by the preg_match anyway. * Neither initializing it with null or an empty array makes much sense because the code below assumes so much more, e.g. that specific elements exist, and are arrays. Again, these guarantees are all given by the preg_match. I find the additional initialization more distracting than helpful. Change-Id: I22b192b59038d9fa51a7e6f04d8d76634ae3de73 |
||
|---|---|---|
| .. | ||
| Hook | ||
| AbstractContent.php | ||
| CodeContentHandler.php | ||
| Content.php | ||
| ContentHandler.php | ||
| ContentHandlerFactory.php | ||
| ContentModelChange.php | ||
| CssContent.php | ||
| CssContentHandler.php | ||
| FileContentHandler.php | ||
| IContentHandlerFactory.php | ||
| JavaScriptContent.php | ||
| JavaScriptContentHandler.php | ||
| JsonContent.php | ||
| JsonContentHandler.php | ||
| MessageContent.php | ||
| TextContent.php | ||
| TextContentHandler.php | ||
| UnknownContent.php | ||
| UnknownContentHandler.php | ||
| WikitextContent.php | ||
| WikitextContentHandler.php | ||
| WikiTextStructure.php | ||