[pmwiki-users] PmForm and uninvited links

Petko Yotov 5ko at 5ko.fr
Thu Feb 13 14:56:33 CST 2014

Randy Brown writes:
> PmForm seems to be creating a link to my profile page, uninvited. I see this  
> when I search for link=Profiles.MyProfile, even though I'm not aware of  
> having created such a link.
> I have several pages interacting:
> 1. MyData: contains a pmform directive that uses MyTemplate (which is in  
> LocalTemplates). "Save" updates the page text variables on this (MyData)  
> page. 
> 2. MyTemplate: (:include:)s other pages, which in turn may include still  
> other pages. Note that the includes can be recursive, and can involve  
> including an anchored section on the current page. Still, my understanding is  
> that links are only indexed if the markup is literally on the page itself. 

Not exactly. When a page is saved, the markup it contains is evaluated, that  
is, the wikitext is converted to HTML, in order to keep track of the link  

With a few exceptions: redirects, inclues, conditionals, pagelists,  
searchresults, and wikitrails are not evaluated. The "(:include ...:)"  
markups on the page are replaced with " " (space) before the text is  
evaluated, same for the other markups.

That means that all other markup, including (:pmform:), will be evaluated  
and if it contains a WikiLink, it will be indexed.

You can disable the evaluation of the (:pmform:) markup by adding this to  

  $SaveAttrPatterns['/\\(:pmform(\\s+.*?)?:\\)/i'] = ' ';

I wonder if this should be added to the pmform.php file.


> Here are some things I've tried, each time re-saving the MyData page to  
> refresh the link index:
> 1. I replace the pmform directive on MyData with a directive to simply  
> (:include:) MyTemplate. Good result: the uninvited link disappears. 
> 2. I return pmform to MyData, but now omit from MyTemplate the include of the  
> other page. Good result: the uninvited link does NOT reappear.
> 3. I make MyData page contain only one line: (:pmform…:). Bad result: the  
> uninvited link re-appears.
> 4. If I delete MyData (in case there was some kind of corruption) and try  
> again, I get the same results.
> What could cause this?
> Randy

More information about the pmwiki-users mailing list