Merge "Add the ability to know if fullscreen is available"
[lhc/web/wiklou.git] / includes / db / DatabasePostgres.php
index 83d8cae..c8830d3 100644 (file)
@@ -827,14 +827,18 @@ __INDEXATTR__;
         * can be locked. That means tables in an outer join cannot be FOR UPDATE locked. Trying to do
         * so causes a DB error. This wrapper checks which tables can be locked and adjusts it accordingly.
         */
-       function selectSQLText( $table, $vars, $conds = '', $fname = __METHOD__, $options = array(), $join_conds = array() ) {
-               $forUpdateKey = array_search( 'FOR UPDATE', $options );
-               if ( $forUpdateKey !== false && $join_conds ) {
-                       unset( $options[$forUpdateKey] );
-
-                       foreach ( $join_conds as $table => $join_cond ) {
-                               if ( 0 === preg_match( '/^(?:LEFT|RIGHT|FULL)(?: OUTER)? JOIN$/i', $join_cond[0] ) ) {
-                                       $options['FOR UPDATE'][] = $table;
+       function selectSQLText( $table, $vars, $conds = '', $fname = __METHOD__,
+               $options = array(), $join_conds = array()
+       ) {
+               if ( is_array( $options ) ) {
+                       $forUpdateKey = array_search( 'FOR UPDATE', $options );
+                       if ( $forUpdateKey !== false && $join_conds ) {
+                               unset( $options[$forUpdateKey] );
+
+                               foreach ( $join_conds as $table_cond => $join_cond ) {
+                                       if ( 0 === preg_match( '/^(?:LEFT|RIGHT|FULL)(?: OUTER)? JOIN$/i', $join_cond[0] ) ) {
+                                               $options['FOR UPDATE'][] = $table_cond;
+                                       }
                                }
                        }
                }
@@ -1061,7 +1065,7 @@ __INDEXATTR__;
 
        /**
         * Return the next in a sequence, save the value for retrieval via insertId()
-        * 
+        *
         * @param string $seqName
         * @return int|null
         */
@@ -1562,7 +1566,7 @@ SQL;
 
                if ( isset( $options['FOR UPDATE'] ) ) {
                        $postLimitTail .= ' FOR UPDATE OF ' . implode( ', ', $options['FOR UPDATE'] );
-               } else if ( isset( $noKeyOptions['FOR UPDATE'] ) ) {
+               } elseif ( isset( $noKeyOptions['FOR UPDATE'] ) ) {
                        $postLimitTail .= ' FOR UPDATE';
                }