Roxen.git/
server/
modules/
tags/
killframe.pike
Branch:
Tag:
Non-build tags
All tags
No tags
1997-06-09
1997-06-09 18:28:28 by Peter Bortas <zino@lysator.liu.se>
afbad29f66e7e8ccac972d6c0dc9b2642d13d22d (
18
lines) (+
10
/-
8
)
[
Show
|
Annotate
]
Branch:
5.2
Made it a little less stupid.
Rev: server/modules/tags/killframe.pike:1.4
1:
/* This is a roxen module. (c) Informationsvävarna AB 1997.
-
* $Id: killframe.pike,v 1.
3
1997/
05
/
24
13
:
51
:
36
grubba
Exp $
+
* $Id: killframe.pike,v 1.
4
1997/
06
/
09
18
:
28
:
28
peter
Exp $
* * Adds some java script that will prevent others from putting * your page in a frame. *
-
* Will also
strip
any
occurences
of
the string '
index.html
'
-
*
from
the URL.
Currently this is done a bit clumsy, making
-
* URLs like http://www.roxen.com/index.html/foo.html break,
-
* this should be fixed.
+
* Will also
remove
occuranses
of
"
index.html
"
at
the
end
of
the URL.
* * made by Peter Bortas <peter@infovav.se> Januari -97 */
28:
"<killframe>: Adds some java script that will prevent others\n" " from putting your page in a frame.\n\n" " Will also strip any occurences of the string\n"
-
" 'index.html' from the URL."
+
" 'index.html' from the
end of the
URL."
"</pre>" ), ({}), 1, });
37:
string tag_killframe( string tag, mapping m, object id ) { // Links to index.html are ugly.
-
string my_url =
id
->
conf->
query("MyWorldLocation") + id->raw_url[1..]
-
-
"index.html"
;
+
string my_url =
roxen
->query("MyWorldLocation") + id->raw_url[1..];
-
+
string flip = reverse(my_url);
+
+
if( flip[0..9] == reverse("index.html") )
+
my_url = reverse(flip[10..]);
+
if (id->supports->javascript) string head = "<script language=javascript>\n" "<!--\n"