Skip to content

Commit

Permalink
Update to PHP 5.4 array syntax.
Browse files Browse the repository at this point in the history
I think this is @Hywan saw when he opened ticket #36. So I think we can
say that this fixes #36.

If not, reopen :)
  • Loading branch information
evert committed Dec 7, 2014
1 parent 5b6653b commit 9bdb0f5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/URLUtil.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ static function decodePath($path) {
static function decodePathSegment($path) {

$path = rawurldecode($path);
$encoding = mb_detect_encoding($path, array('UTF-8','ISO-8859-1'));
$encoding = mb_detect_encoding($path, ['UTF-8','ISO-8859-1']);

switch($encoding) {

Expand Down Expand Up @@ -109,11 +109,11 @@ static function decodePathSegment($path) {
*/
static function splitPath($path) {

$matches = array();
$matches = [];
if(preg_match('/^(?:(?:(.*)(?:\/+))?([^\/]+))(?:\/?)$/u',$path,$matches)) {
return array($matches[1],$matches[2]);
return [$matches[1], $matches[2]];
} else {
return array(null,null);
return [null, null];
}

}
Expand Down

0 comments on commit 9bdb0f5

Please sign in to comment.