Fix syntax error and indenting from r113487
authorSam Reed <reedy@users.mediawiki.org>
Fri, 9 Mar 2012 19:05:29 +0000 (19:05 +0000)
committerSam Reed <reedy@users.mediawiki.org>
Fri, 9 Mar 2012 19:05:29 +0000 (19:05 +0000)
includes/db/DatabasePostgres.php

index c38d3a6..7dcbc5f 100644 (file)
@@ -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;
        }