Difference between revisions of "Issue:DPL allows transclusion of non-transcludable namespaces"

From FollowTheScore
Jump to: navigation, search
(Reply)
(Reply)
 
Line 26: Line 26:
 
:[[User:Gero|Gero]] 21:06, 27 March 2008 (CET)
 
:[[User:Gero|Gero]] 21:06, 27 March 2008 (CET)
 
:Any hints as to whereto look in the code?  I can certainly look at it.  [[User:Ooom|Ooom]] 21:09, 27 March 2008 (CET)
 
:Any hints as to whereto look in the code?  I can certainly look at it.  [[User:Ooom|Ooom]] 21:09, 27 March 2008 (CET)
 +
::Actually, it turned out to be fairly easy to fix.  Below are the changes I made (called out) in a larger context.  It is around line 2680 in DynamicPageList2.php  [[User:Ooom|Ooom]] 21:26, 27 March 2008 (CET)
 +
<pre><nowiki>
 +
        // page_id=rev_page (if revision table required)
 +
        $sSqlWhere .= $sSqlCond_page_rev;
 +
   
 +
        // count(all categories) <= max no of categories
 +
        $sSqlWhere .= $sSqlCond_MaxCat;
 +
       
 +
       
 +
        ///////////////////////////////JMS Changes
 +
        if(is_array($wgNonincludableNamespaces) && array_count_values($wgNonincludableNamespaces) > 0)
 +
        {
 +
        $sSqlWhere .= ' AND ' .$sPageTable.'.page_namespace not in (' . implode(',', $wgNonincludableNamespaces) . ')';
 +
        }
 +
        ///////////////////////////////End JMS Change
 +
       
 +
       
 +
        // page_id=pl.pl_from (if pagelinks table required)
 +
        $sSqlWhere .= $sSqlCond_page_pl;
 +
</nowiki></pre>

Latest revision as of 21:26, 27 March 2008

Description: DPL allows transclusion of non-transcludable namespaces
Extension / Version: DPL   /   1.6.4
Type / Status: Bug   /   open

Problem

On our wiki, we have some non-transcludable namespaces (which are also locked down by user). However, when using DPL, I can do something like:

 <DPL>
   namespace=SecuredNamespace
   include=*
   format=,<H3>[[%PAGE%|%TITLE%]]</H3>,<BR>,
 </DPL>

to get all the contents of that namespace. Yikes!

As a note, these are namespaces that have been placed into the standard $wgNonincludableNamespaces array, and as such, should be available to DPL.

Reply

Yes, the current version of DPL does not care about the $wgNonincludableNamespaces array. If you or someone else came up with a patch for the DPL source code which does the job I would certainly make that part of the next release.

Gero 21:06, 27 March 2008 (CET)
Any hints as to whereto look in the code? I can certainly look at it. Ooom 21:09, 27 March 2008 (CET)
Actually, it turned out to be fairly easy to fix. Below are the changes I made (called out) in a larger context. It is around line 2680 in DynamicPageList2.php Ooom 21:26, 27 March 2008 (CET)
        // page_id=rev_page (if revision table required)
        $sSqlWhere .= $sSqlCond_page_rev;
    
        // count(all categories) <= max no of categories
        $sSqlWhere .= $sSqlCond_MaxCat;
        
        
        ///////////////////////////////JMS Changes
        if(is_array($wgNonincludableNamespaces) && array_count_values($wgNonincludableNamespaces) > 0)
        {
	        $sSqlWhere .= ' AND ' .$sPageTable.'.page_namespace not in (' . implode(',', $wgNonincludableNamespaces) . ')';
        }
        ///////////////////////////////End JMS Change
        
        
        // page_id=pl.pl_from (if pagelinks table required)
        $sSqlWhere .= $sSqlCond_page_pl;