[pmwiki-users] disallow off-site images?

Patrick R. Michaud pmichaud at pobox.com
Sat Jan 28 09:54:27 CST 2006


On Sat, Jan 28, 2006 at 08:30:16AM +0000, Hans wrote:
> Saturday, January 28, 2006, 4:25:11 AM, Waylan wrote:
> > You edit a page and add some acceptable offsite links. Upon saving the
> > page, you enter the url-aproval password and everything is good.
> > Later, someone else comes along and adds an offending image link. He
> > is asked for the url-approval password (which he doesn't know) so his
> > link/image does not work - but yours were already approved so they
> > still will. Latter, you revisit the page and see there is a url
> > awaiting aproval. Upon examination you determine is is unexceptable
> > and delete it from the source. At this point you can add more links
> > and approve them etc.
> 
> But by approving  a site to display links to the site I automatically
> approve  also of links to images hosted on that site. There is no
> differentiation. So someone adding image links like for instance
> http://approvedsite.com/pathtoimages/image.jpg has the image displayed
> automatically, no further approval necessary, as the site is already
> approved.
> 
> My point: I don't see a mechanism which will block display of images
> and other of-site material but still allow the display of links to
> pages on the other site.

Perhaps you could switch to approving urls individually instead of
approving entire sites...?

  $UnapprovedLinkFmt = 
    "\$LinkText<a class='apprlink' href='{\$PageUrl}?action=approveurls'>$[(approve links)]</a>");

Another possibility might be to automatically approve any urls
not containing an image extension, and require approval for all
urls that do have one.  Something like:

  $WhitePatterns[] = "^(?!.*$ImgExtPattern\$)";

which says to automatically approve any url that doesn't have
.gif, .jpg, .png, etc. at the end of it.  Then the Site.ApprovedUrls
pages would simply be used to approve sites (or urls) on which
images are also approved.

There are probably other possibilities, but that's a couple of ideas
of how this could be approached.

Pm




More information about the pmwiki-users mailing list