Merge "RCFilters: Don't load JS or redirect when transcluding"
[lhc/web/wiklou.git] / resources / src / mediawiki.rcfilters / mw.rcfilters.UriProcessor.js
index 3e1191f..7bb0a22 100644 (file)
         */
        mw.rcfilters.UriProcessor.prototype._normalizeTargetInUri = function ( uri ) {
                var parts,
-                       re = /^((?:\/.+\/)?.+:.+)\/(.+)$/; // matches [namespace:]Title/Subpage
+                       // matches [/wiki/]SpecialNS:RCL/[Namespace:]Title/Subpage/Subsubpage/etc
+                       re = /^((?:\/.+?\/)?.*?:.*?)\/(.*)$/;
 
                // target in title param
                if ( uri.query.title ) {
                }
 
                // target in path
-               parts = uri.path.match( re );
+               parts = mw.Uri.decode( uri.path ).match( re );
                if ( parts ) {
                        uri.path = parts[ 1 ];
                        uri.query.target = parts[ 2 ];