Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #6667

Re: strip_tags function

From Gregor Kofler <usenet@gregorkofler.com>
Newsgroups comp.lang.php
Subject Re: strip_tags function
Date 2012-07-26 23:54 +0200
Organization A noiseless patient Spider
Message-ID <juseag$ook$1@dont-email.me> (permalink)
References <mgu218tlttv5gelvjj2jpcf8na6tmq876f@4ax.com> <r9v2181fv3eh22o3p9s9u3aluus3m48q3t@4ax.com> <jus21h$meo$2@news.albasani.net>

Show all headers | View raw


Am 2012-07-26 20:24, The Natural Philosopher meinte:
> Tim Fardell wrote:
>> On Thu, 26 Jul 2012 18:18:44 +0100, Tim Fardell
>> <tim.fardell.all-your-clothes@virgin.net> wrote:
>>
>>> However, am I right in thinking that the strip_tags() function simply
>>> assumes
>>> that any less-than character (<) occurring within a string is the
>>> beginning of a
>>> tag?
>>> I hope I'm wrong, because that would be completely crap and useless :-)
>>
>> Apologies for following-up my own post, but I just realised the answer
>> to my own
>> question.
>> I think I am correct that strip_tags assumes any '<' character to be the
>> beginning of a tag - but this doesn't actually matter, since the input
>> string
>> should be HTML encoded anyway, so all '<' characters should be escaped
>> as '&lt;'
>> - so all actual '<' characters will indeed be tags :-)
>>
>> So I wasn't wrong, but it's not as crap and useless as I thought!
> I was about to say 'so does your browser'
>
> There is a function that only strips certain listed tags, but I cant
> remember what it is

strip_tags? It's just the other way round: You have to supply the 
allowed tags.

Gregor

Back to comp.lang.php | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

strip_tags function Tim Fardell <tim.fardell.all-your-clothes@virgin.net> - 2012-07-26 18:18 +0100
  Re: strip_tags function Tim Fardell <tim.fardell.all-your-clothes@virgin.net> - 2012-07-26 18:27 +0100
    Re: strip_tags function The Natural Philosopher <tnp@invalid.invalid> - 2012-07-26 19:24 +0100
      Re: strip_tags function Gregor Kofler <usenet@gregorkofler.com> - 2012-07-26 23:54 +0200
    Re: strip_tags function "Álvaro G. Vicario" <alvaro.NOSPAMTHANX@demogracia.com.invalid> - 2012-07-27 08:25 +0200
    Re: strip_tags function Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-07-27 11:52 +0200
      Re: strip_tags function Tim Fardell <tim.fardell.all-your-clothes@virgin.net> - 2012-07-27 18:25 +0100
        Re: strip_tags function Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-07-28 12:42 +0200
          Re: strip_tags function Tim Fardell <tim.fardell.all-your-clothes@virgin.net> - 2012-07-31 20:17 +0100
            Re: strip_tags function Jerry Stuckle <jstucklex@attglobal.net> - 2012-07-31 15:30 -0400
              Re: strip_tags function Tim Fardell <tim.fardell.all-your-clothes@virgin.net> - 2012-07-31 20:37 +0100
                Re: strip_tags function Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-08-01 06:56 +0200
                Re: strip_tags function Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-08-01 07:15 +0200
            Re: strip_tags function Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-08-01 06:49 +0200

csiph-web