r60964 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r60963‎ | r60964 | r60965 >
Date:07:24, 12 January 2010
Author:reedy
Status:ok
Tags:
Comment:
Reversion/followup to r59300 as per Tims comment
Modified paths:
  • /trunk/phase3/includes/MagicWord.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/MagicWord.php
@@ -320,19 +320,19 @@
321321 }
322322
323323 /**
324 - * Returns the number of times the text contains the word
325 - * @return int
 324+ * Returns true if the text contains the word
 325+ * @return bool
326326 */
327327 function match( $text ) {
328 - return preg_match( $this->getRegex(), $text );
 328+ return (bool)preg_match( $this->getRegex(), $text );
329329 }
330330
331331 /**
332 - * Returns if the text starts with the word
333 - * @return int
 332+ * Returns true if the text starts with the word
 333+ * @return bool
334334 */
335335 function matchStart( $text ) {
336 - return preg_match( $this->getRegexStart(), $text );
 336+ return (bool)preg_match( $this->getRegexStart(), $text );
337337 }
338338
339339 /**

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r59300bug 21583 MagicWord::match function documentation is wrong...reedy22:28, 20 November 2009

Status & tagging log