Conteúdo Html função PHP seguros
Sabado, março 28, 2009 2:43Lar função de limpeza para a entrada de html, mas mais testes etmedım gozukuor hos
copyright: http://www.ysfkc.com/dosyalar/guvenliHtml.phps
função guvenliHtml ($ text) (
global $ start;
$ KonumK = 0; # <(Kucuktur) caracteres que temos visto, a última posição do
$ KonumB = 0; #> (büyüktür) caracteres que temos visto, a última posição do
Tag_mi $ = False; # tag dentro somos nós?
OzellikSablon $ = "; # = valor de característica é ser usado para chamadas global formatindaki
$ TagTablosu = array (); # informações de marca no alacagi global
$ OzellikTablosu = array (); # característica (atributo) informações no alacagi global
$ DegerTablosu = array (); # value () em informações alacagi global
# Variáveis globais definidas para valores
guvenliGlobal ();
# Texto antes do processo de yapılan Isle na correção
$ Text = onDuzeltme ($ texto);
$ I = 0;
$ Buffer = ";
$ Text konumK = strpos ($, '<', $ i); # <rastlandigi caráter primeira posição
KonumB $ = strpos ($ texto, '>', $ i); #> rastlandigi caráter primeira posição
# Verificar as tags de permitir que o texto dentro do nosso
while (True) (
# Rastlandiysa Se o caractere <, mais uma vez
# Ou <character encontrado but> bulunamadiysa caráter
if (($ konumK! konumK == false & & $ <$ konumB) | | ($ konumK! == false & & $ konumB === false)) (
# Icerisindeysek tag
if ($ tag_mi) (
# TAG em <olamayacagi para a parte tag sandigimiz
# Basindaki caractere <<para o cevre frase
$ Buffer .= '<'. texto substr ($, $ i, $ konumK - $ i);
# TAG dentro degilseniz
) Else (
#
$ Buffer .= substr texto ($, $ i, $ konumK - $ i);
)
$ I = $ konumK + 1;
$ Text konumK = strpos ($, '<', $ i);
# Tag Fixação
$ Tag_mi = True;
# Rastlandiysa Se o personagem>, mais uma vez
# Ou> personagem encontrado, mas <bulunamadiysa caráter
) Elseif (($ konumB! KonumK == false & & $> $ konumB) | | konumB ($ konumK === false & & $! == False)) (
# Icerisindeysek Tag
if ($ tag_mi) (
# Düzeltilmiş Adicionar tag
$ Buffer .= guvenliTag (substr (texto $, $ i, konumB $ - $ i));
# Tag Fechar
Tag_mi $ = False;
# TAG dentro degilseniz
) Else (
Obter a parte Kodar # aqui
# E> caracteres> a frase cevre
$ Buffer .= substr (texto $, $ i, konumB $ - $ i). '>';
)
$ I = $ konumB 1;
KonumB $ = strpos ($ texto, '>', $ i);
# Se <ou> rastlanmadiysa caráter
) Else (
# Icerisindeysek Tag
if ($ tag_mi) (
# O personagem comum Última <<para o cevre frase
# E adicionar o Devamini buffer de texto
$ Buffer .= '<'. texto substr ($, $ i);
) Else (
# O final do texto da posição Devamini Kalina adicionar tampão
$ Buffer .= substr texto ($, $ i);
)
# Tag Cik artik kalmadigina gore Dong
break;
)
)
return $ buffer;
)
# ------------------------------------------------- -------------------------------------------------
função onDuzeltme ($ text) (
$ DegisiklikOncesi ='';
Necessário enquanto degistirilmesi bolum oldugu # continua
while ($ degisiklikOncesi! = $ texto) (
$ Text = $ degisiklikOncesi;
# & # Xx formato escrito alguns personagens, çevriliyor karsiliklarina ASCII
# Algumas tags permitem atiliyor e Conteúdos
$ Text = preg_replace ( '/ / Si ', ", $ text);
$ Text = preg_replace ( '/
$ Text = preg_replace ( '/








































