From eee30c7fd05b6cd4d1dbe8a98056cf71681e05af Mon Sep 17 00:00:00 2001 From: Sam Reed Date: Fri, 9 Mar 2012 19:05:29 +0000 Subject: [PATCH] Fix syntax error and indenting from r113487 --- includes/db/DatabasePostgres.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/includes/db/DatabasePostgres.php b/includes/db/DatabasePostgres.php index c38d3a688c..7dcbc5fb48 100644 --- a/includes/db/DatabasePostgres.php +++ b/includes/db/DatabasePostgres.php @@ -814,7 +814,9 @@ class DatabasePostgres extends DatabaseBase { $limit = strlen( $text )-1; $output = array(); } - if( '{}' != $text ) + if( '{}' == $text ) { + return $output; + } do { if ( '{' != $text{$offset} ) { preg_match( "/(\\{?\"([^\"\\\\]|\\\\.)*\"|[^,{}]+)+([,}]+)/", @@ -823,10 +825,12 @@ class DatabasePostgres extends DatabaseBase { $output[] = ( '"' != $match[1]{0} ? $match[1] : stripcslashes( substr( $match[1], 1, -1 ) ) ); - if ( '},' == $match[3] ) + if ( '},' == $match[3] ) { return $output; - } else - $offset = $this->pg_array_parse( $text, $output[], $limit, $offset+1 ); + } + } else { + $offset = $this->pg_array_parse( $text, $output, $limit, $offset+1 ); + } } while ( $limit > $offset ); return $output; } -- 2.20.1