Skip to content
Snippets Groups Projects
  1. Jun 26, 2015
  2. Jun 25, 2015
  3. Jun 24, 2015
    • Jenkins for ownCloud's avatar
      [tx-robot] updated from transifex · fcfd3806
      Jenkins for ownCloud authored
      fcfd3806
    • Thomas Müller's avatar
      Merge pull request #823 from owncloud/more_url_detection_tests · 1548cc47
      Thomas Müller authored
      Add more url tests
      1548cc47
    • JC Brand's avatar
      Updated regex for URL detection. updates #641 · 721be793
      JC Brand authored
      This regex takes a bit of a different approach. Instead of matching allowed
      characters, it instead checks that disallowed characters are not present.
      
      Here's the regex:
      /(ht|f)tp(s?)\:\/\/[a-zA-Z0-9\-\._]+(\:[0-9]+)?(\/[^!*';:@&=+$,?#\ \]]*)*(\?[^!*';:\=@&+$,?#\ \]]+=[^!*';:\=@&$?#\ \]]+(&[^!*';:\=@&+$,?#\ \]]+=[^!*';:\=@&+$?#\ \]]*)*)?(\#\!?[^!*';:@&$,?#\ \]]*)?/
      
      Breaking it down (the URL spec is [here](http://www.w3.org/Addressing/URL/url-spec.txt) ):
      
      /
      (ht|f)tp(s?)\:      The scheme (or protocol) with the colon that separates the scheme from the rest of the URL., Matches http: or ftp: or https: or ftps:
      \/\/                This matches the double slash which indicates the start of internet protocol parts.
      [a-zA-Z0-9\-\._]+   The Internet domain name or IP adresss (e.g. www.google.com, localhost, 192.168.1.1 )
      (\:[0-9]+)?         The optional port number preceded by a colon (e.g. :8080)
      (\/)?([^!*';:@&=+$,?#\ \]]*) The path. (e.g. Addressing/URL/url-spec.txt )
      (
          \?[^!*';:\=@&+$,?%#\ \]]+=[^!*';:\=@&$?#\ \]]+    This matches the first URL paremeter (i.e. ?a=3).
          (&[^!*';:\=@&+$,?%#\ \]]+=[^!*';:\=@&$?#\ \]]+)* This matches subsequent URL parameters (i.e. &x=2&z=7)
      )?                  This says that the URL parameters are optional.
      (\#\!?[^!*';:@&$,?#\ \]]*)?    This matches zero or one document fragments and shebangs (e.g. #section or #!shebang )
      /
      
      The regex is very long and you might notice that there are certain clauses that are repeated, such as "[^!*';:\=@&$?#\ \]]+".
      
      I don't know much about using regexes in PHP, perhaps these clauses could be labeled or put in variables so that the regex could be made shorter?
      
      I'll leave that to someone else who knows better about how that could be done.
      
      Update regex after jenkins test failures.
      
      - Allow colon : in the path.
      - Disallow double quotes "
      
      Disallow round brackets in URL parameter values.
      
      Also disallow brackets for the first URL parameter value.
      721be793
    • Steffen Lindner's avatar
      Add more url tests · e7f9bbfc
      Steffen Lindner authored
      e7f9bbfc
    • Jan-Christoph Borchardt's avatar
      Merge pull request #818 from Xefir/master · feb49e65
      Jan-Christoph Borchardt authored
      Prevent Firefox e10s to crash when registerProtocolHandler
      feb49e65
  4. Jun 22, 2015
  5. Jun 21, 2015
  6. Jun 20, 2015
  7. Jun 19, 2015
  8. Jun 18, 2015
Loading