http://www.mediawiki.org/wiki/Special:Code/MediaWiki/73582

Revision: 73582
Author:   kwisatz
Date:     2010-09-22 23:20:36 +0000 (Wed, 22 Sep 2010)

Log Message:
-----------
fixed bug in QrCode where QrCode would be generated repeatedly for special pages

Modified Paths:
--------------
    trunk/extensions/QrCode/QrCode.php

Modified: trunk/extensions/QrCode/QrCode.php
===================================================================
--- trunk/extensions/QrCode/QrCode.php  2010-09-22 23:14:16 UTC (rev 73581)
+++ trunk/extensions/QrCode/QrCode.php  2010-09-22 23:20:36 UTC (rev 73582)
@@ -5,6 +5,7 @@
  * @license: LGPL (GNU Lesser General Public License) 
http://www.gnu.org/licenses/lgpl.html
  *
  * @file QrCode.php
+ * @ingroup QrCode
  *
  * @author David Raison
  *
@@ -55,6 +56,14 @@
  * to OOP patterns.
  */
 function newQrCode() {
+       global $wgTitle;
+
+       // we're not generating QrCodes for pages in the "Special" namespace
+       // as that can lead to multiple "uploads" on i.e. Special:Ask 
+       if ( $wgTitle->getNamespace() === -1 ) {
+               return false;
+       }
+
        $params = func_get_args();
        $parser = array_shift($params); // drop the parser
 



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

Reply via email to