r86168 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r86167‎ | r86168 | r86169 >
Date:01:19, 16 April 2011
Author:nad
Status:deferred
Tags:
Comment:
fix regex
Modified paths:
  • /trunk/extensions/FileAttach/FileAttach.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FileAttach/FileAttach.php
@@ -9,7 +9,7 @@
1010 *
1111 */
1212 if ( !defined( 'MEDIAWIKI' ) ) die( 'Not an entry point.' );
13 -define( 'FILEATTCH_VERSION', '1.0.0, 2010-04-14' );
 13+define( 'FILEATTCH_VERSION', '1.0.1, 2010-04-16' );
1414
1515 $wgAttachmentHeading = 'Attachments';
1616
@@ -50,7 +50,7 @@
5151 if( is_array( $sections ) && count( $sections ) > 0 ) {
5252 $last = $sections[count( $sections ) - 1];
5353 if( $last['level'] == 2 && $last['anchor'] == $wgAttachmentHeading ) {
54 - preg_match( "|<h2>.+?$wgAttachmentHeading.+?</h2>\s*<ul>(.+?)</ul>|s", $out->mBodytext, $files );
 54+ preg_match( "|.+<h2>.+?$wgAttachmentHeading.+?</h2>\s*<ul>(.+?)</ul>|s", $out->mBodytext, $files );
5555 preg_match_all( "|<li>\s*<a.+?>(.+?)</a>\s*</li>|", $files[1], $files );
5656 $html = "\n\n<!-- files attachments rendered by Extension:FileAttach -->\n<div class=\"file-attachments\" style=\"width:85%\">\n";
5757 foreach( $files[1] as $file ) {

Status & tagging log