Browse Source

Remove .txt torrent download option

ISPs can't see filenames through TLS. This option is useless in a
codebase that forces HTTPS, and only confuses users.
spaghetti 4 years ago
parent
commit
69c165ee75

+ 3
- 7
classes/torrentsdl.class.php View File

@@ -86,7 +86,7 @@ class TorrentsDL {
86 86
   public function add_file(&$TorrentData, $Info, $FolderName = '') {
87 87
     $FolderName = Misc::file_string($FolderName);
88 88
     $MaxPathLength = $FolderName ? (self::MaxPathLength - strlen($FolderName) - 1) : self::MaxPathLength;
89
-    $FileName = self::construct_file_name($Info['Artist'], $Info['Name'], $Info['Year'], $Info['Media'], $Info['Format'], $Info['Encoding'], $Info['TorrentID'], false, $MaxPathLength);
89
+    $FileName = self::construct_file_name($Info['Artist'], $Info['Name'], $Info['Year'], $Info['Media'], $Info['Format'], $Info['Encoding'], $Info['TorrentID'], $MaxPathLength);
90 90
     $this->Size += $Info['Size'];
91 91
     $this->NumAdded++;
92 92
     $this->Zip->add_file(self::get_file($TorrentData, $this->AnnounceURL, $this->AnnounceList), ($FolderName ? "$FolderName/" : "") . $FileName);
@@ -176,12 +176,11 @@ class TorrentsDL {
176 176
    *
177 177
    * @params most input variables are self-explanatory
178 178
    * @param int $TorrentID if given, append "-TorrentID" to torrent name
179
-   * @param bool $Txt whether to use .txt or .torrent as file extension
180 179
    * @param int $MaxLength maximum file name length
181 180
    * @return file name with at most $MaxLength characters
182 181
    */
183
-  public static function construct_file_name($Artist, $Album, $Year, $Media, $Format, $Encoding, $TorrentID = false, $Txt = false, $MaxLength = self::MaxPathLength) {
184
-    $MaxLength -= ($Txt ? 4 : 8);
182
+  public static function construct_file_name($Artist, $Album, $Year, $Media, $Format, $Encoding, $TorrentID = false, $MaxLength = self::MaxPathLength) {
183
+    $MaxLength -= 8; // ".torrent"
185 184
     if ($TorrentID !== false) {
186 185
       $MaxLength -= (strlen($TorrentID) + 1);
187 186
     }
@@ -216,9 +215,6 @@ class TorrentsDL {
216 215
     if ($TorrentID !== false) {
217 216
       $TorrentName .= "-$TorrentID";
218 217
     }
219
-    if ($Txt) {
220
-      return "$TorrentName.txt";
221
-    }
222 218
     return "$TorrentName.torrent";
223 219
   }
224 220
 

+ 31
- 35
classes/users.class.php View File

@@ -18,11 +18,11 @@ class Users {
18 18
       $Classes = G::$DB->to_array('ID');
19 19
       $ClassLevels = G::$DB->to_array('Level');
20 20
       G::$DB->set_query_id($QueryID);
21
-      G::$Cache->cache_value('classes', array($Classes, $ClassLevels), 0);
21
+      G::$Cache->cache_value('classes', [$Classes, $ClassLevels], 0);
22 22
     }
23 23
     $Debug->set_flag('Loaded permissions');
24 24
 
25
-    return array($Classes, $ClassLevels);
25
+    return [$Classes, $ClassLevels];
26 26
   }
27 27
 
28 28
 
@@ -77,29 +77,30 @@ class Users {
77 77
         GROUP BY m.ID");
78 78
 
79 79
       if (!G::$DB->has_results()) { // Deleted user, maybe?
80
-        $UserInfo = array(
81
-            'ID' => $UserID,
82
-            'Username' => '',
83
-            'PermissionID' => 0,
84
-            'Paranoia' => array(),
85
-            'Artist' => false,
86
-            'Donor' => false,
87
-            'Warned' => NULL,
88
-            'Avatar' => '',
89
-            'Enabled' => 0,
90
-            'Title' => '',
91
-            'CatchupTime' => 0,
92
-            'Visible' => '1',
93
-            'Levels' => '',
94
-            'Class' => 0);
80
+        $UserInfo = [
81
+          'ID'           => $UserID,
82
+          'Username'     => '',
83
+          'PermissionID' => 0,
84
+          'Paranoia'     => [],
85
+          'Artist'       => false,
86
+          'Donor'        => false,
87
+          'Warned'       => NULL,
88
+          'Avatar'       => '',
89
+          'Enabled'      => 0,
90
+          'Title'        => '',
91
+          'CatchupTime'  => 0,
92
+          'Visible'      => '1',
93
+          'Levels'       => '',
94
+          'Class'        => 0
95
+        ];
95 96
       } else {
96
-        $UserInfo = G::$DB->next_record(MYSQLI_ASSOC, array('Paranoia', 'Title'));
97
+        $UserInfo = G::$DB->next_record(MYSQLI_ASSOC, ['Paranoia', 'Title']);
97 98
         $UserInfo['CatchupTime'] = strtotime($UserInfo['CatchupTime']);
98 99
         if (!is_array($UserInfo['Paranoia'])) {
99 100
           $UserInfo['Paranoia'] = json_decode($UserInfo['Paranoia'], true);
100 101
         }
101 102
         if (!$UserInfo['Paranoia']) {
102
-          $UserInfo['Paranoia'] = array();
103
+          $UserInfo['Paranoia'] = [];
103 104
         }
104 105
         $UserInfo['Class'] = $Classes[$UserInfo['PermissionID']]['Level'];
105 106
       }
@@ -111,7 +112,7 @@ class Users {
111 112
       if (!empty($UserInfo['Levels'])) {
112 113
         $UserInfo['ExtraClasses'] = array_fill_keys(explode(',', $UserInfo['Levels']), 1);
113 114
       } else {
114
-        $UserInfo['ExtraClasses'] = array();
115
+        $UserInfo['ExtraClasses'] = [];
115 116
       }
116 117
       unset($UserInfo['Levels']);
117 118
       $EffectiveClass = $UserInfo['Class'];
@@ -169,7 +170,6 @@ class Users {
169 170
           i.DisableForums,
170 171
           i.DisableTagging,
171 172
           i.SiteOptions,
172
-          i.DownloadAlt,
173 173
           i.LastReadNews,
174 174
           i.LastReadBlog,
175 175
           i.RestrictedForums,
@@ -181,24 +181,22 @@ class Users {
181 181
         FROM users_main AS m
182 182
           INNER JOIN users_info AS i ON i.UserID = m.ID
183 183
         WHERE m.ID = '$UserID'");
184
-      $HeavyInfo = G::$DB->next_record(MYSQLI_ASSOC, array('CustomPermissions', 'SiteOptions'));
184
+      $HeavyInfo = G::$DB->next_record(MYSQLI_ASSOC, ['CustomPermissions', 'SiteOptions']);
185 185
 
186
+      $HeavyInfo['CustomPermissions'] = [];
186 187
       if (!empty($HeavyInfo['CustomPermissions'])) {
187 188
         $HeavyInfo['CustomPermissions'] = json_decode($HeavyInfo['CustomPermissions'], true);
188
-      } else {
189
-        $HeavyInfo['CustomPermissions'] = array();
190 189
       }
191 190
 
191
+      $RestrictedForums = [];
192 192
       if (!empty($HeavyInfo['RestrictedForums'])) {
193 193
         $RestrictedForums = array_map('trim', explode(',', $HeavyInfo['RestrictedForums']));
194
-      } else {
195
-        $RestrictedForums = array();
196 194
       }
197 195
       unset($HeavyInfo['RestrictedForums']);
196
+
197
+      $PermittedForums = [];
198 198
       if (!empty($HeavyInfo['PermittedForums'])) {
199 199
         $PermittedForums = array_map('trim', explode(',', $HeavyInfo['PermittedForums']));
200
-      } else {
201
-        $PermittedForums = array();
202 200
       }
203 201
       unset($HeavyInfo['PermittedForums']);
204 202
 
@@ -219,16 +217,15 @@ class Users {
219 217
         $PermittedForums = array_merge($PermittedForums, array_map('trim', explode(',', $Perms['PermittedForums'])));
220 218
       }
221 219
 
220
+      $HeavyInfo['CustomForums'] = null;
222 221
       if (!empty($PermittedForums) || !empty($RestrictedForums)) {
223
-        $HeavyInfo['CustomForums'] = array();
222
+        $HeavyInfo['CustomForums'] = [];
224 223
         foreach ($RestrictedForums as $ForumID) {
225 224
           $HeavyInfo['CustomForums'][$ForumID] = 0;
226 225
         }
227 226
         foreach ($PermittedForums as $ForumID) {
228 227
           $HeavyInfo['CustomForums'][$ForumID] = 1;
229 228
         }
230
-      } else {
231
-        $HeavyInfo['CustomForums'] = null;
232 229
       }
233 230
       if (isset($HeavyInfo['CustomForums'][''])) {
234 231
         unset($HeavyInfo['CustomForums']['']);
@@ -491,13 +488,12 @@ class Users {
491 488
       $GroupIDs = G::$DB->collect('GroupID');
492 489
       $BookmarkData = G::$DB->to_array('GroupID', MYSQLI_ASSOC);
493 490
       G::$DB->set_query_id($QueryID);
494
-      G::$Cache->cache_value("bookmarks_group_ids_$UserID",
495
-        array($GroupIDs, $BookmarkData), 3600);
491
+      G::$Cache->cache_value("bookmarks_group_ids_$UserID", [$GroupIDs, $BookmarkData], 3600);
496 492
     }
497 493
 
498 494
     $TorrentList = Torrents::get_groups($GroupIDs);
499 495
 
500
-    return array($GroupIDs, $BookmarkData, $TorrentList);
496
+    return [$GroupIDs, $BookmarkData, $TorrentList];
501 497
   }
502 498
 
503 499
   /**
@@ -669,7 +665,7 @@ class Users {
669 665
    */
670 666
   public static function auth_location($UserID, $Username, $ASN, $Email) {
671 667
     $AuthKey = Users::make_secret();
672
-    G::$Cache->cache_value('new_location_'.$AuthKey, array('UserID'=>$UserID, 'ASN'=>$ASN), 3600*2);
668
+    G::$Cache->cache_value('new_location_'.$AuthKey, ['UserID'=>$UserID, 'ASN'=>$ASN], 3600*2);
673 669
     require(SERVER_ROOT . '/classes/templates.class.php');
674 670
     $TPL = NEW TEMPLATE;
675 671
     $TPL->open(SERVER_ROOT . '/templates/new_location.tpl');

+ 0
- 1
gazelle.sql View File

@@ -1457,7 +1457,6 @@ CREATE TABLE `users_info` (
1457 1457
   `ViewAvatars` enum('0','1') NOT NULL DEFAULT '1',
1458 1458
   `Donor` enum('0','1') NOT NULL DEFAULT '0',
1459 1459
   `Artist` enum('0','1') NOT NULL DEFAULT '0',
1460
-  `DownloadAlt` enum('0','1') NOT NULL DEFAULT '0',
1461 1460
   `Warned` datetime,
1462 1461
   `SupportFor` varchar(255),
1463 1462
   `TorrentGrouping` enum('0','1','2') NOT NULL COMMENT '0=Open,1=Closed,2=Off',

+ 5
- 10
sections/torrents/download.php View File

@@ -2,8 +2,7 @@
2 2
 if (!isset($_REQUEST['authkey']) || !isset($_REQUEST['torrent_pass'])) {
3 3
   enforce_login();
4 4
   $TorrentPass = $LoggedUser['torrent_pass'];
5
-  $DownloadAlt = $LoggedUser['DownloadAlt'];
6
-  $UserID     = $LoggedUser['ID'];
5
+  $UserID    = $LoggedUser['ID'];
7 6
   $AuthKey   = $LoggedUser['AuthKey'];
8 7
 } else {
9 8
   if (strpos($_REQUEST['torrent_pass'], '_') !== false) {
@@ -13,7 +12,7 @@ if (!isset($_REQUEST['authkey']) || !isset($_REQUEST['torrent_pass'])) {
13 12
   $UserInfo = $Cache->get_value('user_'.$_REQUEST['torrent_pass']);
14 13
   if (!is_array($UserInfo)) {
15 14
     $DB->query("
16
-      SELECT ID, DownloadAlt, la.UserID
15
+      SELECT ID, la.UserID
17 16
       FROM users_main AS m
18 17
         INNER JOIN users_info AS i ON i.UserID = m.ID
19 18
         LEFT JOIN locked_accounts AS la ON la.UserID = m.ID
@@ -23,7 +22,7 @@ if (!isset($_REQUEST['authkey']) || !isset($_REQUEST['torrent_pass'])) {
23 22
     $Cache->cache_value('user_'.$_REQUEST['torrent_pass'], $UserInfo, 3600);
24 23
   }
25 24
   $UserInfo = array($UserInfo);
26
-  list($UserID, $DownloadAlt, $Locked) = array_shift($UserInfo);
25
+  list($UserID, $Locked) = array_shift($UserInfo);
27 26
   if (!$UserID) {
28 27
     error(0);
29 28
   }
@@ -179,13 +178,9 @@ $DB->query("
179 178
 
180 179
 Torrents::set_snatch_update_time($UserID, Torrents::SNATCHED_UPDATE_AFTERDL);
181 180
 $Contents = file_get_contents(TORRENT_STORE.$TorrentID.'.torrent');
182
-$FileName = TorrentsDL::construct_file_name($Info['PlainArtists'], $Name, $Year, $Media, $Format, $Encoding, $TorrentID, $DownloadAlt);
181
+$FileName = TorrentsDL::construct_file_name($Info['PlainArtists'], $Name, $Year, $Media, $Format, $Encoding, $TorrentID);
183 182
 
184
-if ($DownloadAlt) {
185
-  header('Content-Type: text/plain; charset=utf-8');
186
-} elseif (!$DownloadAlt || $Failed) {
187
-  header('Content-Type: application/x-bittorrent; charset=utf-8');
188
-}
183
+header('Content-Type: application/x-bittorrent; charset=utf-8');
189 184
 header('Content-disposition: attachment; filename="'.$FileName.'"');
190 185
 
191 186
 function add_passkey($ann) {

+ 1
- 9
sections/user/edit.php View File

@@ -18,14 +18,13 @@ $DB->query("
18 18
     i.StyleURL,
19 19
     i.SiteOptions,
20 20
     i.UnseededAlerts,
21
-    i.DownloadAlt,
22 21
     p.Level AS Class,
23 22
     i.InfoTitle
24 23
   FROM users_main AS m
25 24
     JOIN users_info AS i ON i.UserID = m.ID
26 25
     LEFT JOIN permissions AS p ON p.ID = m.PermissionID
27 26
   WHERE m.ID = '".db_string($UserID)."'");
28
-list($Username, $TwoFactor, $Email, $IRCKey, $Paranoia, $Info, $Avatar, $StyleID, $StyleURL, $SiteOptions, $UnseededAlerts, $DownloadAlt, $Class, $InfoTitle) = $DB->next_record(MYSQLI_NUM, array(4, 9));
27
+list($Username, $TwoFactor, $Email, $IRCKey, $Paranoia, $Info, $Avatar, $StyleID, $StyleURL, $SiteOptions, $UnseededAlerts, $Class, $InfoTitle) = $DB->next_record(MYSQLI_NUM, array(4, 9));
29 28
 
30 29
 $TwoFA = new TwoFactorAuth();
31 30
 
@@ -324,13 +323,6 @@ echo $Val->GenerateJS('userform');
324 323
           <label for="novotelinks">Disable voting links</label>
325 324
         </td>
326 325
       </tr>
327
-      <tr id="tor_dltext_tr">
328
-        <td class="label tooltip" title="Some ISPs block the downloading of torrent files. Enable this option if you wish to download torrent files with a &quot;.txt&quot; file extension."><strong>Text file downloads</strong></td>
329
-        <td>
330
-          <input type="checkbox" name="downloadalt" id="downloadalt"<?=$DownloadAlt ? ' checked="checked"' : ''?> />
331
-          <label for="downloadalt">Enable downloading torrent files as text files</label>
332
-        </td>
333
-      </tr>
334 326
       <tr id="tor_hidequestionable_tr">
335 327
         <td class="label tooltip" title="Prevent torrents with these tags from showing up on the torrent search page"><strong>Content Filtering</strong></td>
336 328
         <td>

+ 28
- 36
sections/user/take_edit.php View File

@@ -20,21 +20,21 @@ if ($UserID != $LoggedUser['ID'] && !check_perms('users_edit_profiles', $Permiss
20 20
 }
21 21
 
22 22
 $Val->SetFields('stylesheet', 1, "number", "You forgot to select a stylesheet.");
23
-$Val->SetFields('styleurl', 0, "regex", "You did not enter a valid stylesheet URL.", array('regex' => '/^'.CSS_REGEX.'$/i'));
23
+$Val->SetFields('styleurl', 0, "regex", "You did not enter a valid stylesheet URL.", ['regex' => '/^'.CSS_REGEX.'$/i']);
24 24
 // The next two are commented out because the drop-down menus were replaced with a check box and radio buttons
25 25
 //$Val->SetFields('disablegrouping', 0, "number", "You forgot to select your torrent grouping option.");
26 26
 //$Val->SetFields('torrentgrouping', 0, "number", "You forgot to select your torrent grouping option.");
27
-$Val->SetFields('postsperpage', 1, "number", "You forgot to select your posts per page option.", array('inarray' => array(25, 50, 100)));
28
-//$Val->SetFields('hidecollage', 1, "number", "You forgot to select your collage option.", array('minlength' => 0, 'maxlength' => 1));
27
+$Val->SetFields('postsperpage', 1, "number", "You forgot to select your posts per page option.", ['inarray' => [25, 50, 100]]);
28
+//$Val->SetFields('hidecollage', 1, "number", "You forgot to select your collage option.", ['minlength' => 0, 'maxlength' => 1]);
29 29
 $Val->SetFields('collagecovers', 1, "number", "You forgot to select your collage option.");
30
-$Val->SetFields('avatar', 0, "regex", "You did not enter a valid avatar URL.", array('regex' => "/^".IMAGE_REGEX."$/i"));
30
+$Val->SetFields('avatar', 0, "regex", "You did not enter a valid avatar URL.", ['regex' => "/^".IMAGE_REGEX."$/i"]);
31 31
 $Val->SetFields('email', 1, "email", "You did not enter a valid email address.");
32
-$Val->SetFields('twofa', 0, "regex", "You did not enter a valid 2FA verification code.", array('regex' => '/^[0-9]{6}$/'));
33
-$Val->SetFields('irckey', 0, "string", "You did not enter a valid IRC key. An IRC key must be between 6 and 32 characters long.", array('minlength' => 6, 'maxlength' => 32));
34
-$Val->SetFields('new_pass_1', 0, "regex", "You did not enter a valid password. A valid password is 6 characters or longer.", array('regex' => '/(?=^.{6,}$).*$/'));
35
-$Val->SetFields('new_pass_2', 1, "compare", "Your passwords do not match.", array('comparefield' => 'new_pass_1'));
32
+$Val->SetFields('twofa', 0, "regex", "You did not enter a valid 2FA verification code.", ['regex' => '/^[0-9]{6}$/']);
33
+$Val->SetFields('irckey', 0, "string", "You did not enter a valid IRC key. An IRC key must be between 6 and 32 characters long.", ['minlength' => 6, 'maxlength' => 32]);
34
+$Val->SetFields('new_pass_1', 0, "regex", "You did not enter a valid password. A valid password is 6 characters or longer.", ['regex' => '/(?=^.{6,}$).*$/']);
35
+$Val->SetFields('new_pass_2', 1, "compare", "Your passwords do not match.", ['comparefield' => 'new_pass_1']);
36 36
 if (check_perms('site_advanced_search')) {
37
-  $Val->SetFields('searchtype', 1, "number", "You forgot to select your default search preference.", array('minlength' => 0, 'maxlength' => 1));
37
+  $Val->SetFields('searchtype', 1, "number", "You forgot to select your default search preference.", ['minlength' => 0, 'maxlength' => 1]);
38 38
 }
39 39
 
40 40
 $Err = $Val->ValidateForm($_POST);
@@ -75,7 +75,7 @@ if (isset($_POST['p_snatched_c']) && isset($_POST['p_seeding_c']) && isset($_POS
75 75
 
76 76
 // if showing exactly 2 of stats, show all 3 of stats
77 77
 $StatsShown = 0;
78
-$Stats = array('downloaded', 'uploaded', 'ratio');
78
+$Stats = ['downloaded', 'uploaded', 'ratio'];
79 79
 foreach ($Stats as $S) {
80 80
   if (isset($_POST["p_$S"])) {
81 81
     $StatsShown++;
@@ -88,15 +88,15 @@ if ($StatsShown == 2) {
88 88
   }
89 89
 }
90 90
 
91
-$Paranoia = array();
92
-$Checkboxes = array('downloaded', 'uploaded', 'ratio', 'lastseen', 'requiredratio', 'invitedcount', 'artistsadded', 'notifications');
91
+$Paranoia = [];
92
+$Checkboxes = ['downloaded', 'uploaded', 'ratio', 'lastseen', 'requiredratio', 'invitedcount', 'artistsadded', 'notifications'];
93 93
 foreach ($Checkboxes as $C) {
94 94
   if (!isset($_POST["p_$C"])) {
95 95
     $Paranoia[] = $C;
96 96
   }
97 97
 }
98 98
 
99
-$SimpleSelects = array('torrentcomments', 'collages', 'collagecontribs', 'uploads', 'uniquegroups', 'perfectflacs', 'seeding', 'leeching', 'snatched');
99
+$SimpleSelects = ['torrentcomments', 'collages', 'collagecontribs', 'uploads', 'uniquegroups', 'perfectflacs', 'seeding', 'leeching', 'snatched'];
100 100
 foreach ($SimpleSelects as $S) {
101 101
   if (!isset($_POST["p_$S".'_c']) && !isset($_POST["p_$S".'_l'])) {
102 102
     // Very paranoid - don't show count or list
@@ -107,7 +107,7 @@ foreach ($SimpleSelects as $S) {
107 107
   }
108 108
 }
109 109
 
110
-$Bounties = array('requestsfilled', 'requestsvoted');
110
+$Bounties = ['requestsfilled', 'requestsvoted'];
111 111
 foreach ($Bounties as $B) {
112 112
   if (isset($_POST["p_$B".'_list'])) {
113 113
     $_POST["p_$B".'_count'] = 'on';
@@ -292,7 +292,7 @@ if (!empty($_POST['sorthide'])) {
292 292
     $Options['SortHide'][$E[0]] = $E[1];
293 293
   }
294 294
 } else {
295
-  $Options['SortHide'] = array();
295
+  $Options['SortHide'] = [];
296 296
 }
297 297
 
298 298
 if (check_perms('site_advanced_search')) {
@@ -306,7 +306,6 @@ unset($Options['ArtistNoRedirect']);
306 306
 unset($Options['ShowQueryList']);
307 307
 unset($Options['ShowCacheList']);
308 308
 
309
-$DownloadAlt = isset($_POST['downloadalt']) ? 1 : 0;
310 309
 $UnseededAlerts = isset($_POST['unseededalerts']) ? 1 : 0;
311 310
 
312 311
 Donations::update_rewards($UserID);
@@ -316,11 +315,11 @@ NotificationsManager::save_settings($UserID);
316 315
 if (!empty($_POST['badges'])) {
317 316
   $BadgeIDs = array_slice($_POST['badges'], 0, 5);
318 317
 } else {
319
-  $BadgeIDs = array();
318
+  $BadgeIDs = [];
320 319
 }
321 320
 
322 321
 $BadgesChanged = false;
323
-$NewBadges = array();
322
+$NewBadges = [];
324 323
 if ($Cache->get_value('user_badges_'.$UserID)) {
325 324
   $Badges = $Cache->get_value('user_badges_'.$UserID);
326 325
   foreach ($Badges as $Badge) {
@@ -334,7 +333,7 @@ if ($Cache->get_value('user_badges_'.$UserID)) {
334 333
       $Displayed = false;
335 334
       $BadgesChanged = true;
336 335
     }
337
-    $NewBadges[] = array('BadgeID' => $Badge['BadgeID'], 'Displayed' => $Displayed?'1':'0');
336
+    $NewBadges[] = ['BadgeID' => $Badge['BadgeID'], 'Displayed' => $Displayed?'1':'0'];
338 337
 
339 338
   }
340 339
 } else {
@@ -345,24 +344,18 @@ if ($BadgesChanged) {
345 344
 }
346 345
 // End Badge settings
347 346
 
348
-// Information on how the user likes to download torrents is stored in cache
349
-if ($DownloadAlt != $LoggedUser['DownloadAlt']) {
350
-  $Cache->delete_value('user_'.$LoggedUser['torrent_pass']);
351
-}
352
-
353 347
 $Cache->begin_transaction("user_info_$UserID");
354
-$Cache->update_row(false, array(
355
-    'Avatar' => display_str($_POST['avatar']),
356
-    'Paranoia' => $Paranoia
357
-));
348
+$Cache->update_row(false, [
349
+  'Avatar' => display_str($_POST['avatar']),
350
+  'Paranoia' => $Paranoia
351
+]);
358 352
 $Cache->commit_transaction(0);
359 353
 
360 354
 $Cache->begin_transaction("user_info_heavy_$UserID");
361
-$Cache->update_row(false, array(
362
-    'StyleID' => $_POST['stylesheet'],
363
-    'StyleURL' => display_str($_POST['styleurl']),
364
-    'DownloadAlt' => $DownloadAlt
365
-    ));
355
+$Cache->update_row(false, [
356
+  'StyleID' => $_POST['stylesheet'],
357
+  'StyleURL' => display_str($_POST['styleurl'])
358
+]);
366 359
 $Cache->update_row(false, $Options);
367 360
 $Cache->commit_transaction(0);
368 361
 
@@ -378,7 +371,6 @@ $SQL = "
378 371
     i.NotifyOnQuote = '".db_string($Options['NotifyOnQuote'])."',
379 372
     i.Info = '".db_string($_POST['info'])."',
380 373
     i.InfoTitle = '".db_string($_POST['profile_title'])."',
381
-    i.DownloadAlt = '$DownloadAlt',
382 374
     i.UnseededAlerts = '$UnseededAlerts',
383 375
     m.Email = '".DBCrypt::encrypt($_POST['email'])."',
384 376
     m.IRCKey = '".db_string($_POST['irckey'])."',
@@ -408,11 +400,11 @@ if (isset($_POST['resetpasskey'])) {
408 400
     VALUES
409 401
       ('$UserID', '$OldPassKey', '$NewPassKey', '$ChangerIP', '".sqltime()."')");
410 402
   $Cache->begin_transaction("user_info_heavy_$UserID");
411
-  $Cache->update_row(false, array('torrent_pass' => $NewPassKey));
403
+  $Cache->update_row(false, ['torrent_pass' => $NewPassKey]);
412 404
   $Cache->commit_transaction(0);
413 405
   $Cache->delete_value("user_$OldPassKey");
414 406
 
415
-  Tracker::update_tracker('change_passkey', array('oldpasskey' => $OldPassKey, 'newpasskey' => $NewPassKey));
407
+  Tracker::update_tracker('change_passkey', ['oldpasskey' => $OldPassKey, 'newpasskey' => $NewPassKey]);
416 408
 }
417 409
 
418 410
 $SQL .= "WHERE m.ID = '".db_string($UserID)."'";

Loading…
Cancel
Save