String Contains Function

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • j1mb0jay

    #1

    String Contains Function

    Is there a function in PHP that will return a boolean if a String
    contains another given String. As what I am trying to do is disallow
    input that contains ../ or something else that would allow directory
    traversal.

    j1mb0jay
  • Rik Wasmus

    #2
    Re: String Contains Function

    On Fri, 11 Jan 2008 23:33:19 +0100, j1mb0jay <none@none.comw rote:
    Is there a function in PHP that will return a boolean if a String
    contains another given String. As what I am trying to do is disallow
    input that contains ../ or something else that would allow directory
    traversal.
    strpos()/regex etc. could be used for this, however, I'd use realpath() on
    the results to check wether it's still 'safe'.
    --
    Rik Wasmus

    Comment

    • j1mb0jay

      #3
      Re: String Contains Function

      Rik Wasmus wrote:
      On Fri, 11 Jan 2008 23:33:19 +0100, j1mb0jay <none@none.comw rote:
      >
      >Is there a function in PHP that will return a boolean if a String
      >contains another given String. As what I am trying to do is disallow
      >input that contains ../ or something else that would allow directory
      >traversal.
      >
      strpos()/regex etc. could be used for this, however, I'd use realpath()
      on the results to check wether it's still 'safe'.
      Did not think of the realpath() function.

      Thank you.

      j1mb0jay

      Comment

      Working...