| |
948 |
948 |
if { ![info exists allowed_protocol([string tolower $protocol])] |
| |
949 |
949 |
&& ![info exists allowed_protocol(*)] } { |
| |
950 |
950 |
return "Your URLs can only use these protocols: [join $allowed_protocols_list ", "]. |
| |
951 |
951 |
You have a '$protocol' protocol in there." |
| |
952 |
952 |
} |
| |
953 |
953 |
} |
| |
954 |
954 |
} |
| |
955 |
955 |
} |
| |
956 |
956 |
} |
| |
957 |
957 |
} |
| |
958 |
958 |
} |
| |
959 |
959 |
return {} |
| |
960 |
960 |
} |
| |
961 |
961 |
|
| |
962 |
962 |
# This was created in order to pre-process some content to be fed |
| |
963 |
963 |
# to tDOM in ad_sanitize_html. In fact, even with its least picky |
| |
964 |
964 |
# behavior, tDOM cannot swallow whatever markup you give it. This |
| |
965 |
965 |
# proc might also be used in order to improve some OpenACS |
| |
966 |
966 |
# routines, like util_close_html_tags. As it has some limitations, |
| |
967 |
967 |
# this is left to future considerations. |
| |
968 |
|
ad_proc -public ad_dom_fix_html { |
| |
|
968 |
ad_proc -private ad_dom_fix_html { |
| |
969 |
969 |
-html:required |
| |
970 |
970 |
{-marker "root"} |
| |
971 |
971 |
-dom:boolean |
| |
972 |
972 |
} { |
| |
973 |
973 |
|
| |
974 |
974 |
Similar in spirit to the famous Tidy command line utility, |
| |
975 |
975 |
this proc takes a piece of possibly invalid markup and returns |
| |
976 |
976 |
a 'fixed' version where unopened tags have been closed and |
| |
977 |
977 |
attribute specifications have been normalized by transforming them |
| |
978 |
978 |
in the form <code>attribute-name="attribute value"</code>. All |
| |
979 |
979 |
attributes with an invalid (non-alphanumeric) name will be |
| |
980 |
980 |
stripped.<br> |
| |
981 |
981 |
<br> |
| |
982 |
982 |
Be aware that every comment and also the possibly present |
| |
983 |
983 |
DOCTYPE declaration will be stripped from the markup. Also, |
| |
984 |
984 |
most of tag's internal whitespace will be trimmed. This |
| |
985 |
985 |
behavior comes from the htmlparse library used in this |
| |
986 |
986 |
implementation. |
| |
987 |
987 |
|
| |
988 |
988 |
@param html Markup to process |