symfony/symfony — pull request #12498 by GeertDD (2014-11-17 15:59:37+00:00)
Title: Config filelocator

| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |

The `isAbsolutePath()` method used array notation to access string characters. Passing an empty string to it, would therefore generate an undefined offset error. Moreover, passing an array that had a slash or backslash in its first element would incorrectly pass as well, e.g. `array('/', 'what', 'ever')`.

Using a simple regular expression here seems like the way to go. It is shorter and easier to read.