asp.net - Why is this looping infinitely? -


So I've been kicked off my site today and I think this function is offender can someone tell me What is that problem? I can not find this address:

  The public function removes string 'HTML tags and other characters in the form of clean text (string as strings) that title tags and descriptions are preferred. Not if not a string, "& lt; img" "& lt; input type =" "hidden" "name ="; IISNullOrEmpty (STR) then 'get rid of the string' {"& lt" in the form of the mini-db slow indexChars () of the expanded tag ";" "" "" "input type =" "hidden" "name =" "Dealing" "" "& lt; Period", "& lt; p;" & lt; ul; "Div", "& lt; Embed" "Object" "& lt; Ultimate"} I get integer = 0 to indexChars.GetUpperBound (0) to get rid of the 'indexchars array blur via indexOfInput integer = 0' link indexOfInput = Str.IndexOf (indexes (I) ) Index of index if index F input & lt; & Gt; -1 Then in the form of a dim indexNextLeftBracket integer = str.IndexOf ("& lt;", indexOfInput) + 1 dim indexRightBracket as integer = str.IndexOf ("& gt;", indexOfInput) + 1 ' The correct bracket is not checked if a tag has been omitted if the index booklet & gt; IndexRightBracket then adds the 'normal case str = str.Remove (indexOfInput, indexRightBracket - indexOfInput) or' right bracket just before the next left bracket, just remove everything 'bad tag str = str.Instert (indexNextLeftBracket - 1, " & Gt; ") indexRightBracket = str.IndexOf (" & gt; ", indexOfInput) + 1 str = str.Remove (indexOfInput, indexRightBracket - indexOfInput) end if end then loop indexOfInput = -1 to the next end then return str termination function  

Something like that will not be easy? (OK, I know this is not the same as postcode):

  public string string HTMLTags (string text) {return to Regex.Replace (text, @ "From <(| \ N) *.? & Gt; ", string.Empty); }  

(the conversion should be trivial in VB.NET!)

Note: If you're running this often, there are two performance improvements that you can call Regex .

To use a pre-compiled expression, it is necessary to write a little bit.

Second, use the non-capturing form of regular expression; .NET Regular Expressions (?) Apply syntax, which can be performed as a backfirst for the group without the penalty of the captured captured text, using this syntax, the regular expression given above Can be changed to:

  @ " 

Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -