I don't know if it will be usefull for anyone, I have been using a filter for a long time now that will try and fix the head section so that I at least always have a known pattern and a complete head section to match for in filters which need to inject stuf there...also the main purpose of this filter is to insert a known token, for later filters to match on, so that I could be sure of the order of the injected stuf (each next inject has to be below the previous inject, and with a possibly absent tag in the head section I could not use e.g. </head>),
and I can't wait until one of you shows me a URL where it'll fail, coz nodoubt this will happen, although I haven't yet come accross a site where it did not work.
It has seen many tweaks in it's lifetime, and it's gotten up to the point that I am not even thinking of trying to explain the logic...(small hint, this is a classic CASE/IF-THEN-ELSE construction)
I'll just say this, it's marked multi so I can use the 'fix'ed tags too for later filters.
To make sure it only triggers at the <start> and not on embedded tags in page-generating scripts, it is STOP()ed when it has done it's job.
Name = "Fix: HEAD section insert PING (JarC) [multi]"
Active = TRUE
Multi = TRUE
URL = "*&(^$IHDR(Content-Type:*PrxOriginalType*))&$TYPE(htm)"
Limit = 4096
Match = "<"
"(HTML >9(<HEAD $SET(1=9)"
" |</HEAD $SET(1=9
8
</HEAD>)"
" |<TITLE>8</TITLE $SET(1=9
<TITLE>8</TITLE>) $SET(2=</HEAD>)"
" |</TITLE $SET(1=<TITLE>9</TITLE>) $SET(2=</HEAD>)"
" |<BODY8 $SET(1=9
</HEAD>) $SET(2=<BODY8>)"
" )"
"|HEAD>9(<TITLE>8</TITLE $SET(1=9
<TITLE>8</TITLE>)"
" |</TITLE $SET(1=<TITLE>9</TITLE>)"
" |</HEAD $SET(1=9
</HEAD>)"
" |<BODY8 $SET(1=9
</HEAD>) $SET(2=<BODY8>)"
" )"
"|/HEAD $SET(1=</HEAD>)"
"|TITLE>9</TITLE $SET(1=<TITLE>9</TITLE>) $SET(2=</HEAD>)"
"|/TITLE $SET(1=<TITLE>Untitled</TITLE>) $SET(2=</HEAD>)"
"|BODY8 $SET(1=</HEAD>) $SET(2=<BODY8>)"
")>"
"$STOP()"
Replace = "
<HTML >"
"
<!-- Original Location: u -->"
"
<HEAD>"
"
<!-- PING! -->"
"
1
2
"
Edited by - TEggHead on 01 Sep 2002 12:20:33
a new filter to try.
now i understand also your question about <!--ping -->
<edit>:
what the 8 variable do in this line?
" |</HEAD $SET(1=9
8
</HEAD>)"
altosax.
Edited by - altosax on 01 Sep 2002 13:56:03
: now i understand also your question about <!--ping -->
<edit>:
what the 8 variable do in this line?
" |</HEAD $SET(1=9
8
</HEAD>)"
beats me...probably a leftover from a previous edit...seems as if it can be snuffed without risk...