Index: trunk/extensions/Awesomeness/Awesomeness.php |
— | — | @@ -14,7 +14,7 @@ |
15 | 15 | * @defgroup Awesomeness Awesomeness |
16 | 16 | */ |
17 | 17 | |
18 | | -define( 'Awesomeness_VERSION', 'of awesomeness' ); |
| 18 | +define( 'Awesomeness_VERSION', 'with even moar awesomeness' ); |
19 | 19 | |
20 | 20 | $wgExtensionCredits['other'][] = array( |
21 | 21 | 'path' => __FILE__, |
— | — | @@ -32,10 +32,13 @@ |
33 | 33 | function efAwesomenessInsertion( &$article, &$user, &$text, &$summary, $minor, $watch, $sectionanchor, &$flags ) { |
34 | 34 | $awesomeness = array( 'awesomeness', 'awesome' ); |
35 | 35 | |
36 | | - foreach( $awesomeness as $awesome ) { |
| 36 | + foreach( $awesomeness as &$awesome ) { |
37 | 37 | $awesome = wfMsg( $awesome ); |
38 | | - $text = preg_replace( "/(^|\s|-)({$awesome}[\?!\.\,]?)(\s|$)/i", " '''$2''' ", $text ); |
39 | 38 | } |
| 39 | + |
| 40 | + $words = implode( '|', $awesomeness ); |
| 41 | + |
| 42 | + $text = preg_replace( "/(^|\s|-)((?:{$words})[\?!\.\,]?)(\s|$)/i", " '''$2''' ", $text ); |
40 | 43 | |
41 | 44 | return true; |
42 | 45 | } |