[Pmwiki-users] Re: Re: Safer .php-files

Thomas -Balu- Walter list+pmwiki-users
Sun Feb 29 11:05:10 CST 2004


On Sun, Feb 29, 2004 at 02:37:36PM +0100, Christian Ridderstr?m wrote:
> > One could possibly also do:
> > 
> >     <?php 
> >         if (!defined('PmWiki'))
> >	       { highlight_file($_SERVER['SCRIPT_FILENAME']); exit(); }
> >     ...
> >     ?>
> 
> This works nicely though. Except Balu said something about being able to 
> fiddle with $_SERVER['SCRIPT_FILENAME'] IIRC...

I am doing highlight_file(__FILE__); to display the file highlighted.
__FILE__ is a PHP constant that contains the absolute path and filename
of the actual file.

So far it looks like this is working on all PHP installations and not
broken in some versions or the like.

     Balu



More information about the pmwiki-users mailing list