Jack Phoenix has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/197045

Change subject: Changed the LinkEnd hook to generate valid HTML + bumped 
version number
......................................................................

Changed the LinkEnd hook to generate valid HTML + bumped version number

Change-Id: I94aef34807c506d508d11508d1f1f62ba8d1e173
---
M WikiArticleFeeds.php
M WikiArticleFeeds_body.php
2 files changed, 13 insertions(+), 12 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikiArticleFeeds 
refs/changes/45/197045/1

diff --git a/WikiArticleFeeds.php b/WikiArticleFeeds.php
index 29929f0..8aebda6 100644
--- a/WikiArticleFeeds.php
+++ b/WikiArticleFeeds.php
@@ -4,7 +4,7 @@
  * @author Jim R. Wilson, Thomas Gries
  * @maintainer Thomas Gries
  *
- * @version 0.71
+ * @version 0.72
  * @copyright Copyright (C) 2007 Jim R. Wilson
  * @copyright Copyright (C) 2012 Thomas Gries
  * @license The MIT License - 
http://www.opensource.org/licenses/mit-license.php
@@ -56,6 +56,8 @@
  *
  * Versions
  *
+ * 0.73    Changed the LinkEnd hook handler to generate valid HTML by prefixing
+ *         the userpage-link and usertalkpage-link attributes with "data-"
  * 0.71    removed $wgWikiArticleFeedsTrackingCategory parameter for tracking 
category
  * 0.703   adds the feed icon to the bottom of the toolbox in Monobook or 
like-minded skins.
  * 0.701   version string constant renamed to make it wiki-unique
@@ -125,7 +127,7 @@
        die( "This is not a valid entry point.\n" );
 }
 
-define( 'EXTENSION_WIKIARTICLEFEEDS_VERSION', '0.72.0 20140401' );
+define( 'EXTENSION_WIKIARTICLEFEEDS_VERSION', '0.73.0 20150316' );
 
 # Bring in supporting classes
 require_once( "$IP/includes/Feed.php" );
@@ -141,16 +143,15 @@
        'version' => EXTENSION_WIKIARTICLEFEEDS_VERSION,
 );
 
-$dir = dirname( __FILE__ ) . '/';
 $wgMessagesDirs['WikiArticleFeeds'] = __DIR__ . '/i18n';
-$wgExtensionMessagesFiles['WikiArticleFeeds'] = $dir . 
'WikiArticleFeeds.i18n.php';
-$wgExtensionMessagesFiles['WikiArticleFeedsMagic'] = $dir . 
'WikiArticleFeeds.i18n.magic.php';
+$wgExtensionMessagesFiles['WikiArticleFeeds'] = __DIR__ . 
'/WikiArticleFeeds.i18n.php';
+$wgExtensionMessagesFiles['WikiArticleFeedsMagic'] = __DIR__ . 
'/WikiArticleFeeds.i18n.magic.php';
 
 # Tracking category listed on Special:TrackingCategories
 $wgTrackingCategories[] = 'wikiarticlefeeds-tracking-category';
 
 # Create global instance
-$wgAutoloadClasses['WikiArticleFeeds'] = $dir . 'WikiArticleFeeds_body.php';
+$wgAutoloadClasses['WikiArticleFeeds'] = __DIR__ . 
'/WikiArticleFeeds_body.php';
 
 # Attach Hooks
 $wgHooks['ParserFirstCallInit'][] = 
'WikiArticleFeeds::wfWikiArticleFeedsSetup';
diff --git a/WikiArticleFeeds_body.php b/WikiArticleFeeds_body.php
index c3e29bc..577e244 100644
--- a/WikiArticleFeeds_body.php
+++ b/WikiArticleFeeds_body.php
@@ -111,9 +111,9 @@
         */
        static function wfWikiArticleFeedsAddSignatureMarker( $skin, Title 
$target, array $options, $text, array &$attribs, $ret ) {
                if ( $target->getNamespace() == NS_USER ) {
-                       $attribs['userpage-link'] = 'true';
+                       $attribs['data-userpage-link'] = 'true';
                } elseif ( $target->getNamespace() == NS_USER_TALK ) {
-                       $attribs['usertalkpage-link'] = 'true';
+                       $attribs['data-usertalkpage-link'] = 'true';
                }
                return true;
        }
@@ -391,16 +391,16 @@
 
                                # Try hard to determine the item author and date
                                # Look for a regular signatures of the layout
-                               # userpage-link [optional user_talk page link] 
date (with a delimiting timezone code in parentheses)
+                               # data-userpage-link [optional user_talk page 
link] date (with a delimiting timezone code in parentheses)
 
                                $author = null;
                                $date = null;
 
                                $signatureRegExp = '#<a href=".+?User:.+?" 
title="User:.+?">(.*?)</a> (\d\d):(\d\d), (\d+) ([a-z]+) (\d{4}) 
(\([A-Z]+\))#im';
 
-                               $signatureRegExp1 = 
'#<.*userpage-link.*>(.*?)</a>.*<.*usertalkpage-link.*>.*</a>\) 
(.*\([A-Z]+\))#im';
-                               $signatureRegExp2 = 
'#<.*userpage-link.*>(.*?)</a> (.*\([A-Z]+\))#im';
-                               $signatureRegExp3 = 
'#<.*usertalkpage-link.*>(.*?)</a> (.*\([A-Z]+\))#im';
+                               $signatureRegExp1 = 
'#<.*data-userpage-link.*>(.*?)</a>.*<.*data-usertalkpage-link.*>.*</a>\) 
(.*\([A-Z]+\))#im';
+                               $signatureRegExp2 = 
'#<.*data-userpage-link.*>(.*?)</a> (.*\([A-Z]+\))#im';
+                               $signatureRegExp3 = 
'#<.*data-usertalkpage-link.*>(.*?)</a> (.*\([A-Z]+\))#im';
 
                                $isAttributable = ( preg_match( 
$signatureRegExp1, $seg, $matches )
                                        || preg_match( $signatureRegExp2, $seg, 
$matches )

-- 
To view, visit https://gerrit.wikimedia.org/r/197045
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I94aef34807c506d508d11508d1f1f62ba8d1e173
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikiArticleFeeds
Gerrit-Branch: master
Gerrit-Owner: Jack Phoenix <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to