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

Revision: 99780
Author:   jeroendedauw
Date:     2011-10-14 17:17:59 +0000 (Fri, 14 Oct 2011)
Log Message:
-----------
follow up to r99761

Modified Paths:
--------------
    trunk/extensions/Contest/specials/SpecialMyContests.php

Modified: trunk/extensions/Contest/specials/SpecialMyContests.php
===================================================================
--- trunk/extensions/Contest/specials/SpecialMyContests.php     2011-10-14 
16:05:28 UTC (rev 99779)
+++ trunk/extensions/Contest/specials/SpecialMyContests.php     2011-10-14 
17:17:59 UTC (rev 99780)
@@ -426,8 +426,6 @@
         * HTMLForm field validation-callback for the submissiom field.
         * Warning: regexes used! o_O
         * 
-        * TODO: add support for other services such as Gitorious?
-        * 
         * @since 0.1
         * 
         * @param $value String
@@ -445,14 +443,12 @@
                $allowedPatterns = array(
                        // GitHub URLs such as 
https://github.com/JeroenDeDauw/smwcon/tree/f9b26ec4ba1101b1f5d4ef76b7ae6ad3dabfb53b
                        // 
'@^https://github\.com/[a-zA-Z0-9-]+/[a-zA-Z0-9_-]+/tree/[a-zA-Z0-9]{40}$@i'
-                       
-                       // Any GitHub URL
-                       '@^https?://github\.com/.*$@i',
-                       
-                       // Any Gitorious URL
-                       '@^https?://(www\.)?gitorious\.org/.*$@i',
                );
                
+               foreach ( ContestSettings::get( 'submissionDomains' ) as 
$domain ) {
+                       $allowedPatterns[] = '@^https?://(([a-z0-9]+)\.)?' . 
str_replace( '.', '\.', $domain ) . '/.*$@i';
+               }
+               
                foreach ( $allowedPatterns as $pattern ) {
                        if ( preg_match( $pattern, $value ) ) {
                                return true;


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

Reply via email to