}
# Allow any attribute beginning with "data-"
- if ( !preg_match( '/^data-/i', $attribute ) && !isset( $whitelist[$attribute] ) ) {
+ if ( !preg_match( '/^data-(?!ooui)/i', $attribute ) && !isset( $whitelist[$attribute] ) ) {
continue;
}
// Try cache (unless this needs to lock the DB).
// NOTE: if this thread called saveSettings(), the cache was cleared.
- if ( ( $flags & self::READ_LOCKING ) || !$this->loadFromCache() ) {
+ $locking = ( ( $flags & self::READ_LOCKING ) == self::READ_LOCKING );
+ if ( $locking || !$this->loadFromCache() ) {
wfDebug( "User: cache miss for user {$this->mId}\n" );
// Load from DB (make sure this thread sees its own changes)
if ( wfGetLB()->hasOrMadeRecentMasterChanges() ) {
) {
$rows = 0;
$sql = $this->selectSQLText( $table, '1', $conds, $fname, $options );
- $res = $this->query( "SELECT COUNT(*) AS rowcount FROM ($sql) tmp_count" );
+ $res = $this->query( "SELECT COUNT(*) AS rowcount FROM ($sql) tmp_count", $fname );
if ( $res ) {
$row = $this->fetchRow( $res );
$value = $this->mDefaultBigSelects;
}
} elseif ( $this->mDefaultBigSelects === null ) {
- $this->mDefaultBigSelects = (bool)$this->selectField( false, '@@sql_big_selects' );
+ $this->mDefaultBigSelects = (bool)$this->selectField( false, '@@sql_big_selects', '', __METHOD__ );
}
$encValue = $value ? '1' : '0';
$this->query( "SET sql_big_selects=$encValue", __METHOD__ );
$link = substr( $link, 1 );
}
- $nt = Title::newFromText( $this->mStripState->unstripNoWiki( $link ) );
+ $unstrip = $this->mStripState->unstripNoWiki( $link );
+ $nt = is_string( $unstrip ) ? Title::newFromText( $unstrip ) : null;
if ( $nt === null ) {
$s .= $prefix . '[[' . $line;
continue;