From: Tim Starling Date: Sun, 29 Feb 2004 08:44:59 +0000 (+0000) Subject: wfRecordUpload() using RecentChange instead of direct DB, which fixes a minor bug X-Git-Tag: 1.3.0beta1~908 X-Git-Url: http://git.cyclocoop.org/?a=commitdiff_plain;h=45297d6792a422f799d33896f07fe81f8a3590f1;p=lhc%2Fweb%2Fwiklou.git wfRecordUpload() using RecentChange instead of direct DB, which fixes a minor bug --- diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index 60959b8c26..f813511583 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -545,10 +545,10 @@ function wfRecordUpload( $name, $oldver, $size, $desc ) ",'" . wfStrencode( $textdesc ) . "','{$won}','{$now}')"; wfQuery( $sql, DB_WRITE, $fname ); $id = wfInsertId() or 0; # We should throw an error instead - $sql = "INSERT INTO recentchanges (rc_namespace,rc_title, - rc_comment,rc_user,rc_user_text,rc_timestamp,rc_new, - rc_cur_id,rc_cur_time) VALUES ({$common},{$id},'{$now}')"; - wfQuery( $sql, DB_WRITE, $fname ); + + $titleObj = Title::makeTitle( NS_IMAGE, $name ); + RecentChange::notifyNew( $now, $titleObj, 0, $wgUser, $desc ); + $u = new SearchUpdate( $id, $name, $desc ); $u->doUpdate(); }