@@ -32,17 +32,16 @@ public function blacklistUsernames(array $usernames) {
3232 \wcf \system \WCF ::getDB ()->beginTransaction ();
3333 $ condition = new \wcf \system \database \util \PreparedStatementConditionBuilder ();
3434 $ condition ->add ('username IN (?) ' , array ($ usernames ));
35- $ sql = "DELETE FROM
36- wcf " .WCF_N ."_otu_blacklist
35+ $ sql = "DELETE FROM wcf " .WCF_N ."_otu_blacklist
3736 " .$ condition ;
3837
3938 // save username on One-Time Username blacklist
4039 $ stmt = \wcf \system \WCF ::getDB ()->prepareStatement ($ sql );
4140 $ stmt ->execute ($ condition ->getParameters ());
4241
43- $ sql = "INSERT INTO
44- wcf " . WCF_N . " _otu_blacklist (username, time)
45- VALUES (?, ?) " ;
42+ $ sql = "INSERT INTO wcf " . WCF_N . " _otu_blacklist
43+ (username, time)
44+ VALUES (?, ?) " ;
4645 $ stmt = \wcf \system \WCF ::getDB ()->prepareStatement ($ sql );
4746 foreach ($ usernames as $ username ) {
4847 $ stmt ->execute (array ($ username , TIME_NOW ));
@@ -59,9 +58,8 @@ public function blacklistUsernames(array $usernames) {
5958 public function prune () {
6059 if (OTU_BLACKLIST_LIFETIME == -1 ) return ;
6160
62- $ sql = "DELETE FROM
63- wcf " .WCF_N ."_otu_blacklist
64- WHERE time < ? " ;
61+ $ sql = "DELETE FROM wcf " .WCF_N ."_otu_blacklist
62+ WHERE time < ? " ;
6563 $ stmt = \wcf \system \WCF ::getDB ()->prepareStatement ($ sql );
6664 $ stmt ->execute (array (TIME_NOW - OTU_BLACKLIST_LIFETIME * 86400 ));
6765
@@ -87,11 +85,10 @@ public function rebuildOption() {
8785 if (OTU_BLACKLIST_LIFETIME > -1 ) $ condition ->add ('time > ? ' , array (TIME_NOW - OTU_BLACKLIST_LIFETIME * 86400 ));
8886 else $ condition ->add ('1 = 1 ' );
8987
90- $ sql = "SELECT
91- username
92- FROM
93- wcf " .WCF_N ."_otu_blacklist
94- " .$ condition ;
88+ $ sql = "SELECT username
89+ FROM wcf " .WCF_N ."_otu_blacklist
90+ " .$ condition ."
91+ ORDER BY username ASC " ;
9592 $ stmt = \wcf \system \WCF ::getDB ()->prepareStatement ($ sql );
9693 $ stmt ->execute ($ condition ->getParameters ());
9794
0 commit comments