Index: branches/REL1_17/phase3/includes/db/DatabaseOracle.php |
— | — | @@ -791,6 +791,7 @@ |
792 | 792 | $this->delete( $table, $deleteConds, $fname ); |
793 | 793 | } |
794 | 794 | |
| 795 | + |
795 | 796 | if ( $sequenceData !== false && !isset( $row[$sequenceData['column']] ) ) { |
796 | 797 | $row[$sequenceData['column']] = $this->nextSequenceValue( $sequenceData['sequence'] ); |
797 | 798 | } |
— | — | @@ -1157,28 +1158,41 @@ |
1158 | 1159 | return $s; |
1159 | 1160 | } |
1160 | 1161 | |
1161 | | - function selectRow( $table, $vars, $conds, $fname = 'DatabaseOracle::selectRow', $options = array(), $join_conds = array() ) { |
| 1162 | + private function wrapFieldForWhere( $table, &$col, &$val ) { |
1162 | 1163 | global $wgContLang; |
| 1164 | + |
| 1165 | + $col_info = $this->fieldInfoMulti( $table, $col ); |
| 1166 | + $col_type = $col_info != false ? $col_info->type() : 'CONSTANT'; |
| 1167 | + if ( $col_type == 'CLOB' ) { |
| 1168 | + $col = 'TO_CHAR(' . $col . ')'; |
| 1169 | + $val = $wgContLang->checkTitleEncoding( $val ); |
| 1170 | + } elseif ( $col_type == 'VARCHAR2' && !mb_check_encoding( $val ) ) { |
| 1171 | + $val = $wgContLang->checkTitleEncoding( $val ); |
| 1172 | + } |
| 1173 | + } |
1163 | 1174 | |
1164 | | - if ($conds != null) { |
1165 | | - $conds2 = array(); |
1166 | | - $conds = ( !is_array( $conds ) ) ? array( $conds ) : $conds; |
1167 | | - foreach ( $conds as $col => $val ) { |
1168 | | - $col_info = $this->fieldInfoMulti( $table, $col ); |
1169 | | - $col_type = $col_info != false ? $col_info->type() : 'CONSTANT'; |
1170 | | - if ( $col_type == 'CLOB' ) { |
1171 | | - $conds2['TO_CHAR(' . $col . ')'] = $wgContLang->checkTitleEncoding( $val ); |
1172 | | - } elseif ( $col_type == 'VARCHAR2' && !mb_check_encoding( $val ) ) { |
1173 | | - $conds2[$col] = $wgContLang->checkTitleEncoding( $val ); |
| 1175 | + private function wrapConditionsForWhere ( $table, $conds, $parentCol = null ) { |
| 1176 | + $conds2 = array(); |
| 1177 | + foreach ( $conds as $col => $val ) { |
| 1178 | + if ( is_array( $val ) ) { |
| 1179 | + $conds2[$col] = $this->wrapConditionsForWhere ( $table, $val, $col ); |
| 1180 | + } else { |
| 1181 | + if ( is_numeric( $col ) && $parentCol != null ) { |
| 1182 | + $this->wrapFieldForWhere ( $table, $parentCol, $val ); |
1174 | 1183 | } else { |
1175 | | - $conds2[$col] = $val; |
| 1184 | + $this->wrapFieldForWhere ( $table, $col, $val ); |
1176 | 1185 | } |
| 1186 | + $conds2[$col] = $val; |
1177 | 1187 | } |
| 1188 | + } |
| 1189 | + return $conds2; |
| 1190 | + } |
1178 | 1191 | |
1179 | | - return parent::selectRow( $table, $vars, $conds2, $fname, $options, $join_conds ); |
1180 | | - } else { |
1181 | | - return parent::selectRow( $table, $vars, $conds, $fname, $options, $join_conds ); |
| 1192 | + function selectRow( $table, $vars, $conds, $fname = 'DatabaseOracle::selectRow', $options = array(), $join_conds = array() ) { |
| 1193 | + if ( is_array($conds) ) { |
| 1194 | + $conds = $this->wrapConditionsForWhere( $table, $conds ); |
1182 | 1195 | } |
| 1196 | + return parent::selectRow( $table, $vars, $conds, $fname, $options, $join_conds ); |
1183 | 1197 | } |
1184 | 1198 | |
1185 | 1199 | /** |
— | — | @@ -1225,32 +1239,10 @@ |
1226 | 1240 | } |
1227 | 1241 | |
1228 | 1242 | public function delete( $table, $conds, $fname = 'DatabaseOracle::delete' ) { |
1229 | | - global $wgContLang; |
1230 | | - |
1231 | | - if ( $wgContLang != null && $conds != null && $conds != '*' ) { |
1232 | | - $conds2 = array(); |
1233 | | - $conds = ( !is_array( $conds ) ) ? array( $conds ) : $conds; |
1234 | | - foreach ( $conds as $col => $val ) { |
1235 | | - $col_info = $this->fieldInfoMulti( $table, $col ); |
1236 | | - $col_type = $col_info != false ? $col_info->type() : 'CONSTANT'; |
1237 | | - if ( $col_type == 'CLOB' ) { |
1238 | | - $conds2['TO_CHAR(' . $col . ')'] = $wgContLang->checkTitleEncoding( $val ); |
1239 | | - } else { |
1240 | | - if ( is_array( $val ) ) { |
1241 | | - $conds2[$col] = $val; |
1242 | | - foreach ( $conds2[$col] as &$val2 ) { |
1243 | | - $val2 = $wgContLang->checkTitleEncoding( $val2 ); |
1244 | | - } |
1245 | | - } else { |
1246 | | - $conds2[$col] = $wgContLang->checkTitleEncoding( $val ); |
1247 | | - } |
1248 | | - } |
1249 | | - } |
1250 | | - |
1251 | | - return parent::delete( $table, $conds2, $fname ); |
1252 | | - } else { |
1253 | | - return parent::delete( $table, $conds, $fname ); |
| 1243 | + if ( is_array($conds) ) { |
| 1244 | + $conds = $this->wrapConditionsForWhere( $table, $conds ); |
1254 | 1245 | } |
| 1246 | + return parent::delete( $table, $conds, $fname ); |
1255 | 1247 | } |
1256 | 1248 | |
1257 | 1249 | function update( $table, $values, $conds, $fname = 'DatabaseOracle::update', $options = array() ) { |
— | — | @@ -1273,6 +1265,7 @@ |
1274 | 1266 | } |
1275 | 1267 | |
1276 | 1268 | if ( $conds != '*' ) { |
| 1269 | + $conds = $this->wrapConditionsForWhere( $table, $conds ); |
1277 | 1270 | $sql .= ' WHERE ' . $this->makeList( $conds, LIST_AND ); |
1278 | 1271 | } |
1279 | 1272 | |
Index: branches/REL1_17/phase3/includes/filerepo/ForeignDBRepo.php |
— | — | @@ -37,7 +37,7 @@ |
38 | 38 | if ( !isset( $this->dbConn ) ) { |
39 | 39 | $this->dbConn = DatabaseBase::newFromType( $this->dbType, |
40 | 40 | array( |
41 | | - 'server' => $this->dbServer, |
| 41 | + 'host' => $this->dbServer, |
42 | 42 | 'user' => $this->dbUser, |
43 | 43 | 'password' => $this->dbPassword, |
44 | 44 | 'dbname' => $this->dbName, |
Property changes on: branches/REL1_17/phase3/includes/filerepo/ForeignDBRepo.php |
___________________________________________________________________ |
Modified: svn:mergeinfo |
45 | 45 | Merged /trunk/phase3/includes/filerepo/ForeignDBRepo.php:r80167,81689,87498,89253 |
Index: branches/REL1_17/phase3/includes/resourceloader/ResourceLoader.php |
— | — | @@ -96,7 +96,8 @@ |
97 | 97 | ), __METHOD__ |
98 | 98 | ); |
99 | 99 | foreach ( $res as $row ) { |
100 | | - $this->getModule( $row->mr_resource )->setMsgBlobMtime( $lang, $row->mr_timestamp ); |
| 100 | + $this->getModule( $row->mr_resource )->setMsgBlobMtime( $lang, |
| 101 | + wfTimestamp( TS_UNIX, $row->mr_timestamp ) ); |
101 | 102 | unset( $modulesWithoutMessages[$row->mr_resource] ); |
102 | 103 | } |
103 | 104 | } |
Property changes on: branches/REL1_17/phase3/includes/resourceloader/ResourceLoader.php |
___________________________________________________________________ |
Modified: svn:mergeinfo |
104 | 105 | Merged /trunk/phase3/includes/resourceloader/ResourceLoader.php:r80167,81689,87498,89253 |
Index: branches/REL1_17/phase3/includes/resourceloader/ResourceLoaderUserOptionsModule.php |
— | — | @@ -40,7 +40,7 @@ |
41 | 41 | global $wgUser; |
42 | 42 | |
43 | 43 | if ( $context->getUser() === $wgUser->getName() ) { |
44 | | - return $this->modifiedTime[$hash] = $wgUser->getTouched(); |
| 44 | + return $this->modifiedTime[$hash] = wfTimestamp( TS_UNIX, $wgUser->getTouched() ); |
45 | 45 | } else { |
46 | 46 | return 1; |
47 | 47 | } |
Index: branches/REL1_17/phase3/includes/resourceloader/ResourceLoaderStartUpModule.php |
— | — | @@ -119,7 +119,10 @@ |
120 | 120 | } |
121 | 121 | // Automatically register module |
122 | 122 | else { |
123 | | - $mtime = max( $module->getModifiedTime( $context ), wfTimestamp( TS_UNIX, $wgCacheEpoch ) ); |
| 123 | + // getModifiedTime() is supposed to return a UNIX timestamp, but it doesn't always |
| 124 | + // seem to do that, and custom implementations might forget. Coerce it to TS_UNIX |
| 125 | + $moduleMtime = wfTimestamp( TS_UNIX, $module->getModifiedTime( $context ) ); |
| 126 | + $mtime = max( $moduleMtime, wfTimestamp( TS_UNIX, $wgCacheEpoch ) ); |
124 | 127 | // Modules without dependencies or a group pass two arguments (name, timestamp) to |
125 | 128 | // mediaWiki.loader.register() |
126 | 129 | if ( !count( $module->getDependencies() && $module->getGroup() === null ) ) { |