r77440 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r77439‎ | r77440 | r77441 >
Date:21:40, 29 November 2010
Author:jeroendedauw
Status:deferred (Comments)
Tags:
Comment:
regex tweak
Modified paths:
  • /trunk/extensions/Awesomeness/Awesomeness.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Awesomeness/Awesomeness.php
@@ -14,7 +14,7 @@
1515 * @defgroup Awesomeness Awesomeness
1616 */
1717
18 -define( 'Awesomeness_VERSION', 'of awesomeness' );
 18+define( 'Awesomeness_VERSION', 'with even moar awesomeness' );
1919
2020 $wgExtensionCredits['other'][] = array(
2121 'path' => __FILE__,
@@ -32,10 +32,13 @@
3333 function efAwesomenessInsertion( &$article, &$user, &$text, &$summary, $minor, $watch, $sectionanchor, &$flags ) {
3434 $awesomeness = array( 'awesomeness', 'awesome' );
3535
36 - foreach( $awesomeness as $awesome ) {
 36+ foreach( $awesomeness as &$awesome ) {
3737 $awesome = wfMsg( $awesome );
38 - $text = preg_replace( "/(^|\s|-)({$awesome}[\?!\.\,]?)(\s|$)/i", " '''$2''' ", $text );
3938 }
 39+
 40+ $words = implode( '|', $awesomeness );
 41+
 42+ $text = preg_replace( "/(^|\s|-)((?:{$words})[\?!\.\,]?)(\s|$)/i", " '''$2''' ", $text );
4043
4144 return true;
4245 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r77441Merging from r77426 through r77440 of trunkawjrichards22:24, 29 November 2010

Comments

#Comment by Bryan (talk | contribs)   21:33, 1 December 2010

awesome.

Status & tagging log