Roxen.git / server / modules / tags / killframe.pike

version» Context lines:

Roxen.git/server/modules/tags/killframe.pike:5:    *    * Will also remove occuranses of "indexfiles" from the end of the URL.    *    * made by Peter Bortas <peter@roxen.com> Januari -97    *    * Thanks for suggestions and bugreports:    * Barry Treahy <treahy@allianceelec.com>    * Chris Burgess <chris@ibex.co.nz>    */    - constant cvs_version = "$Id: killframe.pike,v 1.36 2004/05/24 23:14:51 mani Exp $"; + constant cvs_version = "$Id: killframe.pike,v 1.37 2004/06/04 08:29:26 _cvs_stephen Exp $";   constant thread_safe=1;      #include <module.h>   inherit "module";      void create()   {    defvar( "killindex", 1, "Remove index files from the URL", TYPE_FLAG,    "If set, the module will remove occurrences of any index file from "    "the end of the URL, leaving only a slash. The index file "
Roxen.git/server/modules/tags/killframe.pike:73:       // Links to index.html are ugly. All pages deserve a uniqe URL, and for    // index-pages that URL in /.    if( query("killindex") || m->killindex )    {    //Get indexfiles from the directory-module if there is one.    array indexfiles = ({});    if( id->conf->dir_module )    indexfiles = id->conf->dir_module->query("indexfiles");    -  int l=strlen(my_url)-1; +  int l=sizeof(my_url)-1;       foreach( indexfiles, string index ) -  if( my_url[l-strlen(index)..] == "/" +index ) -  my_url = my_url[..l-strlen(index)]; +  if( my_url[l-sizeof(index)..] == "/" +index ) +  my_url = my_url[..l-sizeof(index)];    }       // Put back the variables if there were any.    if(id->query)    my_url += "?"+ id->query;       // top.location = self.location breaks some versions of IE.    // Mozilla 3 on Solaris cows with top.frames.length    if( id->client && id->client[0][..8] == "Mozilla/3" )    javascript = ( " if(top.location != \""+ my_url +"\")\n"    " top.location = \""+ my_url +"\";\n" );    else    javascript = ( " if(top.frames.length>1)\n"    " top.location = \""+ my_url +"\";\n" );       return("<script language=\"javascript\"><!--\n"    + javascript    + "//--></script>\n");   }