Browse Source

Code style: replace "array()" with "[]"

This was an automatic mass-replace. Manual replacement of array(...)
will continue
spaghetti 8 years ago
parent
commit
e650a1ab73
100 changed files with 359 additions and 358 deletions
  1. 2
    2
      classes/NMA_API.php
  2. 4
    4
      classes/artists.class.php
  3. 4
    4
      classes/artists_similar.class.php
  4. 2
    2
      classes/autoenable.class.php
  5. 2
    2
      classes/badges.class.php
  6. 5
    5
      classes/bencodedecode.class.php
  7. 2
    2
      classes/bencodetorrent.class.php
  8. 7
    7
      classes/cache.class.php
  9. 2
    2
      classes/calendarview.class.php
  10. 11
    11
      classes/charts.class.php
  11. 6
    6
      classes/debug.class.php
  12. 5
    5
      classes/donations.class.php
  13. 3
    3
      classes/donationsbitcoin.class.php
  14. 2
    2
      classes/feed.class.php
  15. 1
    1
      classes/format.class.php
  16. 7
    7
      classes/forums.class.php
  17. 4
    4
      classes/imagetools.class.php
  18. 3
    3
      classes/invite_tree.class.php
  19. 4
    4
      classes/irc.class.php
  20. 2
    2
      classes/mass_user_bookmarks_editor.class.php
  21. 1
    1
      classes/mass_user_torrents_table_view.class.php
  22. 11
    11
      classes/mediainfo.class.php
  23. 8
    8
      classes/misc.class.php
  24. 7
    7
      classes/mysql.class.php
  25. 11
    11
      classes/notificationsmanager.class.php
  26. 1
    1
      classes/paranoia.class.php
  27. 2
    2
      classes/permissions.class.php
  28. 8
    8
      classes/requests.class.php
  29. 1
    1
      classes/sitehistory.class.php
  30. 2
    2
      classes/sphinxql.class.php
  31. 8
    8
      classes/sphinxqlquery.class.php
  32. 5
    5
      classes/sphinxqlresult.class.php
  33. 2
    2
      classes/subscriptions.class.php
  34. 3
    3
      classes/tags.class.php
  35. 1
    1
      classes/templates.class.php
  36. 4
    4
      classes/testing.class.php
  37. 4
    4
      classes/text.class.php
  38. 3
    3
      classes/textarea_preview.class.php
  39. 1
    1
      classes/tools.class.php
  40. 4
    4
      classes/torrent.class.php
  41. 3
    3
      classes/torrent_32bit.class.php
  42. 14
    14
      classes/torrent_form.class.php
  43. 20
    20
      classes/torrents.class.php
  44. 5
    5
      classes/torrentsdl.class.php
  45. 2
    2
      classes/tracker.class.php
  46. 1
    1
      classes/twofa.class.php
  47. 1
    1
      classes/util.php
  48. 2
    2
      classes/validate.class.php
  49. 2
    2
      classes/view.class.php
  50. 2
    2
      classes/votes.class.php
  51. 3
    3
      design/privateheader.php
  52. 1
    1
      feeds.php
  53. 2
    2
      sections/ajax/announcements.php
  54. 11
    11
      sections/ajax/artist.php
  55. 2
    2
      sections/ajax/better/single.php
  56. 6
    6
      sections/ajax/better/transcode.php
  57. 1
    1
      sections/ajax/bookmarks/artists.php
  58. 2
    2
      sections/ajax/bookmarks/torrents.php
  59. 4
    4
      sections/ajax/browse.php
  60. 10
    10
      sections/ajax/collage.php
  61. 3
    3
      sections/ajax/doujin.php
  62. 3
    3
      sections/ajax/forum/forum.php
  63. 6
    6
      sections/ajax/forum/main.php
  64. 5
    5
      sections/ajax/forum/thread.php
  65. 1
    1
      sections/ajax/get_user_notifications.php
  66. 1
    1
      sections/ajax/inbox/inbox.php
  67. 1
    1
      sections/ajax/inbox/viewconv.php
  68. 1
    1
      sections/ajax/index.php
  69. 4
    3
      sections/ajax/javfill.php
  70. 1
    1
      sections/ajax/news_ajax.php
  71. 3
    3
      sections/ajax/notifications.php
  72. 3
    3
      sections/ajax/request.php
  73. 8
    8
      sections/ajax/requests.php
  74. 1
    1
      sections/ajax/subscriptions.php
  75. 1
    1
      sections/ajax/tcomments.php
  76. 2
    2
      sections/ajax/top10/tags.php
  77. 3
    3
      sections/ajax/top10/torrents.php
  78. 2
    2
      sections/ajax/top10/users.php
  79. 1
    1
      sections/ajax/torrentgroup.php
  80. 1
    1
      sections/ajax/user.php
  81. 1
    1
      sections/ajax/user_recents.php
  82. 1
    1
      sections/ajax/userhistory/post_history.php
  83. 5
    5
      sections/artist/artist.php
  84. 2
    2
      sections/artist/autocomplete.php
  85. 4
    4
      sections/better/snatch.php
  86. 4
    4
      sections/better/transcode.php
  87. 5
    5
      sections/better/transcode_beta.php
  88. 4
    4
      sections/better/upload.php
  89. 3
    3
      sections/bookmarks/torrents.php
  90. 2
    2
      sections/collages/add_artist.php
  91. 2
    2
      sections/collages/add_torrent.php
  92. 3
    3
      sections/collages/artist_collage.php
  93. 1
    1
      sections/collages/manage.php
  94. 1
    1
      sections/collages/manage_artists_handle.php
  95. 1
    1
      sections/collages/manage_handle.php
  96. 1
    1
      sections/collages/new_handle.php
  97. 5
    5
      sections/collages/torrent_collage.php
  98. 3
    3
      sections/comments/comments.php
  99. 1
    1
      sections/forums/forum.php
  100. 0
    0
      sections/forums/poll_mod.php

+ 2
- 2
classes/NMA_API.php View File

@@ -53,7 +53,7 @@ class NMA_API
53 53
     /**
54 54
      * @param array $options
55 55
      */
56
-    function __construct($options = array())
56
+    function __construct($options = [])
57 57
     {
58 58
         if (!isset($options['apikey'])) {
59 59
             return $this->error('You must supply a API Key');
@@ -82,7 +82,7 @@ class NMA_API
82 82
     public function verify($key = false)
83 83
     {
84 84
 
85
-        $options = array();
85
+        $options = [];
86 86
 
87 87
         if ($key !== false) {
88 88
             $options['apikey'] = $key;

+ 4
- 4
classes/artists.class.php View File

@@ -18,8 +18,8 @@ class Artists {
18 18
    * 6 => DJ
19 19
    */
20 20
   public static function get_artists($GroupIDs) {
21
-    $Results = array();
22
-    $DBs = array();
21
+    $Results = [];
22
+    $DBs = [];
23 23
     foreach ($GroupIDs as $GroupID) {
24 24
       if (!is_number($GroupID)) {
25 25
         continue;
@@ -56,12 +56,12 @@ class Artists {
56 56
           G::$Cache->cache_value('groups_artists_'.$GroupID, $New[$GroupID]);
57 57
         }
58 58
         else {
59
-          G::$Cache->cache_value('groups_artists_'.$GroupID, array());
59
+          G::$Cache->cache_value('groups_artists_'.$GroupID, []);
60 60
         }
61 61
       }
62 62
       $Missing = array_diff($GroupIDs, array_keys($Results));
63 63
       if (!empty($Missing)) {
64
-        $Results += array_fill_keys($Missing, array());
64
+        $Results += array_fill_keys($Missing, []);
65 65
       }
66 66
     }
67 67
     return $Results;

+ 4
- 4
classes/artists_similar.class.php View File

@@ -7,7 +7,7 @@ class ARTIST {
7 7
   var $Displayed = false;
8 8
   var $x = 0;
9 9
   var $y = 0;
10
-  var $Similar = array();
10
+  var $Similar = [];
11 11
 
12 12
   function ARTIST($ID = '', $Name = '') {
13 13
     $this->ID = $ID;
@@ -17,7 +17,7 @@ class ARTIST {
17 17
 }
18 18
 
19 19
 class ARTISTS_SIMILAR extends ARTIST{
20
-  var $Artists = array();
20
+  var $Artists = [];
21 21
   var $TotalScore = 0;
22 22
 
23 23
   var $xValues = array(WIDTH=>1);
@@ -49,7 +49,7 @@ class ARTISTS_SIMILAR extends ARTIST{
49 49
 
50 50
 
51 51
     // Get artists that are directly similar to the artist
52
-    $ArtistIDs = array();
52
+    $ArtistIDs = [];
53 53
     G::$DB->query("
54 54
       SELECT
55 55
         s2.ArtistID,
@@ -113,7 +113,7 @@ class ARTISTS_SIMILAR extends ARTIST{
113 113
   }
114 114
 
115 115
   function set_positions() {
116
-    $xValues = array(); // Possible x values
116
+    $xValues = []; // Possible x values
117 117
     $Root = ceil(WIDTH / 4); // Half-way into half of the image
118 118
     $Offset = 4; // Distance from the root (a quarter of the way into the image) to the x value
119 119
 

+ 2
- 2
classes/autoenable.class.php View File

@@ -97,7 +97,7 @@ class AutoEnable {
97 97
             error(404);
98 98
         }
99 99
 
100
-        $UserInfo = array();
100
+        $UserInfo = [];
101 101
         $IDs = (!is_array($IDs)) ? [$IDs] : $IDs;
102 102
 
103 103
         if (count($IDs) == 0) {
@@ -290,7 +290,7 @@ class AutoEnable {
290 290
      * @return array The WHERE conditions for the query
291 291
      */
292 292
     public static function build_search_query($Username, $IP, $SubmittedBetween, $SubmittedTimestamp1, $SubmittedTimestamp2, $HandledUsername, $HandledBetween, $HandledTimestamp1, $HandledTimestamp2, $OutcomeSearch, $Checked) {
293
-        $Where = array();
293
+        $Where = [];
294 294
 
295 295
         if (!empty($Username)) {
296 296
             $Where[] = "um1.Username = '$Username'";

+ 2
- 2
classes/badges.class.php View File

@@ -7,7 +7,7 @@ class Badges {
7 7
    * @return array of BadgeIDs
8 8
    */
9 9
   public static function get_badges($UserID) {
10
-    $Result = array();
10
+    $Result = [];
11 11
 
12 12
     if (G::$Cache->get_value('user_badges_'.$UserID)) {
13 13
       return G::$Cache->get_value('user_badges_'.$UserID);
@@ -64,7 +64,7 @@ class Badges {
64 64
    * @return array of BadgeIDs
65 65
    */
66 66
   public static function get_displayed_badges($UserID) {
67
-    $Result = array();
67
+    $Result = [];
68 68
 
69 69
     $Badges = self::get_badges($UserID);
70 70
 

+ 5
- 5
classes/bencodedecode.class.php View File

@@ -7,7 +7,7 @@ class BencodeDecode extends Bencode {
7 7
   private $Data;
8 8
   private $Length;
9 9
   private $Pos = 0;
10
-  public $Dec = array();
10
+  public $Dec = [];
11 11
   public $ExitOnError = true;
12 12
   const SnipLength = 40;
13 13
 
@@ -91,7 +91,7 @@ class BencodeDecode extends Bencode {
91 91
         return Int64::make($Value);
92 92
 
93 93
       case 'l':
94
-        $Value = array();
94
+        $Value = [];
95 95
         $this->Pos++;
96 96
         while ($this->Data[$this->Pos] != 'e') {
97 97
           if ($this->Pos >= $this->Length) {
@@ -103,7 +103,7 @@ class BencodeDecode extends Bencode {
103 103
         return $Value;
104 104
 
105 105
       case 'd':
106
-        $Value = array();
106
+        $Value = [];
107 107
         $this->Pos++;
108 108
         while ($this->Data[$this->Pos] != 'e') {
109 109
           $Length = substr($this->Data, $this->Pos, strpos($this->Data, ':', $this->Pos) - $this->Pos);
@@ -146,10 +146,10 @@ class BencodeDecode extends Bencode {
146 146
       return Int64::get($Data);
147 147
     }
148 148
     if (is_bool($Data)) {
149
-      return array();
149
+      return [];
150 150
     }
151 151
     if (is_array($Data)) {
152
-      $Output = array();
152
+      $Output = [];
153 153
       foreach ($Data as $Key => $Val) {
154 154
         $Output[$Key] = $this->dump($Escape, $Val);
155 155
       }

+ 2
- 2
classes/bencodetorrent.class.php View File

@@ -4,7 +4,7 @@
4 4
  */
5 5
 class BencodeTorrent extends BencodeDecode {
6 6
   private $PathKey = 'path';
7
-  public $Files = array();
7
+  public $Files = [];
8 8
   public $Size = 0;
9 9
 
10 10
   /**
@@ -31,7 +31,7 @@ class BencodeTorrent extends BencodeDecode {
31 31
         $this->PathKey = 'path.utf-8';
32 32
       }
33 33
       foreach ($InfoDict['files'] as $File) {
34
-        $TmpPath = array();
34
+        $TmpPath = [];
35 35
         foreach ($File[$this->PathKey] as $SubPath) {
36 36
           $TmpPath[] = $SubPath;
37 37
         }

+ 7
- 7
classes/cache.class.php View File

@@ -34,12 +34,12 @@ class CACHE extends Memcache {
34 34
    */
35 35
   const GROUP_VERSION = 5;
36 36
 
37
-  public $CacheHits = array();
38
-  public $MemcacheDBArray = array();
37
+  public $CacheHits = [];
38
+  public $MemcacheDBArray = [];
39 39
   public $MemcacheDBKey = '';
40 40
   protected $InTransaction = false;
41 41
   public $Time = 0;
42
-  private $Servers = array();
42
+  private $Servers = [];
43 43
   private $PersistentKeys = array(
44 44
     'ajax_requests_*',
45 45
     'query_lock_*',
@@ -52,7 +52,7 @@ class CACHE extends Memcache {
52 52
     'global_notification',
53 53
     'notifications_one_reads_*',
54 54
   );
55
-  private $ClearedKeys = array();
55
+  private $ClearedKeys = [];
56 56
 
57 57
   public $CanClear = false;
58 58
   public $InternalCache = true;
@@ -197,7 +197,7 @@ class CACHE extends Memcache {
197 197
     $Value = $this->get($Key);
198 198
     if (!is_array($Value)) {
199 199
       $this->InTransaction = false;
200
-      $this->MemcacheDBKey = array();
200
+      $this->MemcacheDBKey = [];
201 201
       $this->MemcacheDBKey = '';
202 202
       return false;
203 203
     }
@@ -209,7 +209,7 @@ class CACHE extends Memcache {
209 209
 
210 210
   public function cancel_transaction() {
211 211
     $this->InTransaction = false;
212
-    $this->MemcacheDBKey = array();
212
+    $this->MemcacheDBKey = [];
213 213
     $this->MemcacheDBKey = '';
214 214
   }
215 215
 
@@ -385,7 +385,7 @@ class CACHE extends Memcache {
385 385
    * @return array (host => bool status, ...)
386 386
    */
387 387
   public function server_status() {
388
-    $Status = array();
388
+    $Status = [];
389 389
     foreach ($this->Servers as $Server) {
390 390
       $Status["$Server[host]:$Server[port]"] = $this->getServerStatus($Server['host'], $Server['port']);
391 391
     }

+ 2
- 2
classes/calendarview.class.php View File

@@ -32,7 +32,7 @@ class CalendarView {
32 32
 
33 33
   private static function get_events_on($Day, $Events) {
34 34
     // Linear search, Lol.
35
-    $Results = array();
35
+    $Results = [];
36 36
     foreach ($Events as $Event) {
37 37
       if ($Event['StartDay'] == $Day || ($Event['StartDay'] <= $Day && $Event['EndDay'] >= $Day)) {
38 38
         $Results[] = $Event;
@@ -59,7 +59,7 @@ class CalendarView {
59 59
     $DaysInMonth = date('t', mktime(0 ,0 ,0, $Month, 1, $Year));
60 60
     $DaysThisWeek = 1;
61 61
     $DayCounter = 0;
62
-    $DatesArray = array();
62
+    $DatesArray = [];
63 63
 ?>
64 64
 
65 65
     <table class="calendar">

+ 11
- 11
classes/charts.class.php View File

@@ -1,9 +1,9 @@
1 1
 <?
2 2
 class GOOGLE_CHARTS {
3 3
   protected $URL = 'https://chart.googleapis.com/chart';
4
-  protected $Labels = array();
5
-  protected $Data = array();
6
-  protected $Options = array();
4
+  protected $Labels = [];
5
+  protected $Data = [];
6
+  protected $Options = [];
7 7
 
8 8
   public function __construct($Type, $Width, $Height, $Options) {
9 9
     if ($Width * $Height > 300000 || $Height > 1000 || $Width > 1000) {
@@ -72,7 +72,7 @@ class GOOGLE_CHARTS {
72 72
 }
73 73
 
74 74
 class AREA_GRAPH extends GOOGLE_CHARTS {
75
-  public function __construct ($Width, $Height, $Options = array()) {
75
+  public function __construct ($Width, $Height, $Options = []) {
76 76
     parent::__construct('lc', $Width, $Height, $Options);
77 77
   }
78 78
 
@@ -83,7 +83,7 @@ class AREA_GRAPH extends GOOGLE_CHARTS {
83 83
   public function generate() {
84 84
     $Max = max($this->Data);
85 85
     $Min = ((isset($this->Options['Break'])) ? $Min = min($this->Data) : 0);
86
-    $Data = array();
86
+    $Data = [];
87 87
     foreach ($this->Data as $Value) {
88 88
       $Data[] = $this->encode((($Value - $Min) / ($Max - $Min)) * 4095);
89 89
     }
@@ -92,7 +92,7 @@ class AREA_GRAPH extends GOOGLE_CHARTS {
92 92
 }
93 93
 
94 94
 class PIE_CHART extends GOOGLE_CHARTS {
95
-  public function __construct ($Width, $Height, $Options = array()) {
95
+  public function __construct ($Width, $Height, $Options = []) {
96 96
     $Type = ((isset($this->Options['3D'])) ? 'p3' : 'p');
97 97
     parent::__construct($Type, $Width, $Height, $Options);
98 98
   }
@@ -110,7 +110,7 @@ class PIE_CHART extends GOOGLE_CHARTS {
110 110
       $this->Data = array_reverse($this->Data);
111 111
     }
112 112
 
113
-    $Data = array();
113
+    $Data = [];
114 114
     $Labels = $this->Labels;
115 115
     $OtherPercentage = 0.00;
116 116
     $OtherData = 0;
@@ -145,7 +145,7 @@ class PIE_CHART extends GOOGLE_CHARTS {
145 145
 
146 146
 class LOG_BAR_GRAPH extends GOOGLE_CHARTS {
147 147
   //TODO: Finish.
148
-  public function __construct ($Base, $Width, $Height, $Options = array()) {
148
+  public function __construct ($Base, $Width, $Height, $Options = []) {
149 149
     parent::__construct('lc', $Width, $Height, $Options);
150 150
   }
151 151
 
@@ -156,7 +156,7 @@ class LOG_BAR_GRAPH extends GOOGLE_CHARTS {
156 156
   public function generate() {
157 157
     $Max = max($this->Data);
158 158
     $Min = ((isset($this->Options['Break'])) ? $Min = min($this->Data) : 0);
159
-    $Data = array();
159
+    $Data = [];
160 160
     foreach ($this->Data as $Value) {
161 161
       $Data[] = $this->encode((($Value - $Min) / ($Max - $Min)) * 4095);
162 162
     }
@@ -182,8 +182,8 @@ class POLL_GRAPH extends GOOGLE_CHARTS {
182 182
     $Max = max($this->Data);
183 183
     $Sum = array_sum($this->Data);
184 184
     $Increment = ($Max / $Sum) * 25; // * 100% / 4divisions
185
-    $Data = array();
186
-    $Labels = array();
185
+    $Data = [];
186
+    $Labels = [];
187 187
     foreach ($this->Data as $Key => $Value) {
188 188
       $Data[] = $this->encode(($Value / $Max) * 4095);
189 189
       $Labels[] = '@t'.str_replace(array(' ', ','),array('+', '\,'), $this->Labels[$Key]).',000000,1,'.round((($Key + 1) / $Count) - (12 / $Height), 2).':0,12';

+ 6
- 6
classes/debug.class.php View File

@@ -7,14 +7,14 @@ define('MAX_MEMORY', 80 * 1024 * 1024); //Maximum memory used per pageload
7 7
 define('MAX_QUERIES', 30); //Maxmimum queries
8 8
 
9 9
 class DEBUG {
10
-  public $Errors = array();
11
-  public $Flags = array();
12
-  public $Perf = array();
13
-  private $LoggedVars = array();
10
+  public $Errors = [];
11
+  public $Flags = [];
12
+  public $Perf = [];
13
+  private $LoggedVars = [];
14 14
 
15 15
   public function profile($Automatic = '') {
16 16
     global $ScriptStartTime;
17
-    $Reason = array();
17
+    $Reason = [];
18 18
 
19 19
     if (!empty($Automatic)) {
20 20
       $Reason[] = $Automatic;
@@ -136,7 +136,7 @@ class DEBUG {
136 136
 
137 137
   protected function format_args($Array) {
138 138
     $LastKey = -1;
139
-    $Return = array();
139
+    $Return = [];
140 140
     foreach ($Array as $Key => $Val) {
141 141
       $Return[$Key] = '';
142 142
       if (!is_int($Key) || $Key != $LastKey + 1) {

+ 5
- 5
classes/donations.class.php View File

@@ -229,7 +229,7 @@ class Donations {
229 229
         // 2 hours less than 32 days to account for schedule run times
230 230
 
231 231
     if (G::$DB->record_count() > 0) {
232
-      $UserIDs = array();
232
+      $UserIDs = [];
233 233
       while (list($UserID, $Rank) = G::$DB->next_record()) {
234 234
         G::$Cache->delete_value("donor_info_$UserID");
235 235
         G::$Cache->delete_value("donor_title_$UserID");
@@ -403,7 +403,7 @@ class Donations {
403 403
 
404 404
 
405 405
   public static function get_enabled_rewards($UserID) {
406
-    $Rewards = array();
406
+    $Rewards = [];
407 407
     $Rank = self::get_rank($UserID);
408 408
     $SpecialRank = self::get_special_rank($UserID);
409 409
     $HasAll = $SpecialRank == 3;
@@ -495,9 +495,9 @@ class Donations {
495 495
     $SpecialRank = self::get_special_rank($UserID);
496 496
     $HasAll = $SpecialRank == 3;
497 497
     $Counter = 0;
498
-    $Insert = array();
499
-    $Values = array();
500
-    $Update = array();
498
+    $Insert = [];
499
+    $Values = [];
500
+    $Update = [];
501 501
 
502 502
     $Insert[] = "UserID";
503 503
     $Values[] = "'$UserID'";

+ 3
- 3
classes/donationsbitcoin.class.php View File

@@ -10,9 +10,9 @@ class DonationsBitcoin {
10 10
       $Donations = BitcoinRpc::listreceivedbyaddress();
11 11
     }
12 12
     if (empty($Donations)) {
13
-      return array();
13
+      return [];
14 14
     }
15
-    $BTCUsers = array();
15
+    $BTCUsers = [];
16 16
     foreach ($Donations as $Account) {
17 17
       $BTCUsers[$Account->address] = $Account->amount;
18 18
     }
@@ -108,7 +108,7 @@ class DonationsBitcoin {
108 108
     if (G::$DB->has_results()) {
109 109
       $UserIDs = G::$DB->to_pair(0, 1);
110 110
     } else {
111
-      $UserIDs = array();
111
+      $UserIDs = [];
112 112
     }
113 113
     G::$DB->set_query_id($QueryID);
114 114
     return $UserIDs;

+ 2
- 2
classes/feed.class.php View File

@@ -47,7 +47,7 @@ class FEED {
47 47
     global $Cache;
48 48
     $Entries = $Cache->get_value($CacheKey);
49 49
     if (!$Entries) {
50
-      $Entries = array();
50
+      $Entries = [];
51 51
     } else {
52 52
       foreach ($Entries as $Item) {
53 53
         echo str_replace(array('[[PASSKEY]]', '[[AUTHKEY]]'), array(display_str($PassKey), display_str($AuthKey)), $Item);
@@ -59,7 +59,7 @@ class FEED {
59 59
     global $Cache;
60 60
     $Entries = $Cache->get_value($CacheKey, true);
61 61
     if (!$Entries) {
62
-      $Entries = array();
62
+      $Entries = [];
63 63
     } else {
64 64
       if (count($Entries) >= 50) {
65 65
         array_pop($Entries);

+ 1
- 1
classes/format.class.php View File

@@ -408,7 +408,7 @@ class Format {
408 408
    * @param array $Array The array the option is in, defaults to GET.
409 409
    * @return void
410 410
    */
411
-  public static function selected($Name, $Value, $Attribute = 'selected', $Array = array()) {
411
+  public static function selected($Name, $Value, $Attribute = 'selected', $Array = []) {
412 412
     if (empty($Array)) {
413 413
       $Array = $_GET;
414 414
     }

+ 7
- 7
classes/forums.class.php View File

@@ -134,7 +134,7 @@ class Forums {
134 134
       G::$DB->query("
135 135
         SELECT ID, Name
136 136
         FROM forums_categories");
137
-      $ForumCats = array();
137
+      $ForumCats = [];
138 138
       while (list ($ID, $Name) = G::$DB->next_record()) {
139 139
         $ForumCats[$ID] = $Name;
140 140
       }
@@ -180,7 +180,7 @@ class Forums {
180 180
       G::$DB->query("
181 181
         SELECT ForumID, ThreadID
182 182
         FROM forums_specific_rules");
183
-      $SpecificRules = array();
183
+      $SpecificRules = [];
184 184
       while (list($ForumID, $ThreadID) = G::$DB->next_record(MYSQLI_NUM, false)) {
185 185
         $SpecificRules[$ForumID][] = $ThreadID;
186 186
       }
@@ -189,7 +189,7 @@ class Forums {
189 189
         if (isset($SpecificRules[$ForumID])) {
190 190
           $Forum['SpecificRules'] = $SpecificRules[$ForumID];
191 191
         } else {
192
-          $Forum['SpecificRules'] = array();
192
+          $Forum['SpecificRules'] = [];
193 193
         }
194 194
       }
195 195
       G::$Cache->cache_value('forums_list', $Forums, 0);
@@ -205,7 +205,7 @@ class Forums {
205 205
     if (isset(G::$LoggedUser['CustomForums'])) {
206 206
       return (array)array_keys(G::$LoggedUser['CustomForums'], 1);
207 207
     } else {
208
-      return array();
208
+      return [];
209 209
     }
210 210
   }
211 211
 
@@ -217,7 +217,7 @@ class Forums {
217 217
     if (isset(G::$LoggedUser['CustomForums'])) {
218 218
       return (array)array_keys(G::$LoggedUser['CustomForums'], 0);
219 219
     } else {
220
-      return array();
220
+      return [];
221 221
     }
222 222
   }
223 223
 
@@ -232,7 +232,7 @@ class Forums {
232 232
     } else {
233 233
       $PerPage = POSTS_PER_PAGE;
234 234
     }
235
-    $TopicIDs = array();
235
+    $TopicIDs = [];
236 236
     foreach ($Forums as $Forum) {
237 237
       if (!empty($Forum['LastPostTopicID'])) {
238 238
         $TopicIDs[] = $Forum['LastPostTopicID'];
@@ -259,7 +259,7 @@ class Forums {
259 259
       $LastRead = G::$DB->to_array('TopicID', MYSQLI_ASSOC);
260 260
       G::$DB->set_query_id($QueryID);
261 261
     } else {
262
-      $LastRead = array();
262
+      $LastRead = [];
263 263
     }
264 264
     return $LastRead;
265 265
   }

+ 4
- 4
classes/imagetools.class.php View File

@@ -9,7 +9,7 @@ class ImageTools {
9 9
    * Store processed links to avoid repetition
10 10
    * @var array 'URL' => 'Parsed URL'
11 11
    */
12
-  private static $Storage = array();
12
+  private static $Storage = [];
13 13
 
14 14
   /**
15 15
    * We use true as an extra property to make the domain an array key
@@ -52,14 +52,14 @@ class ImageTools {
52 52
    * Array of user IDs whose avatars have been checked for size
53 53
    * @var array $CheckedAvatars
54 54
    */
55
-  private static $CheckedAvatars = array();
56
-  private static $CheckedAvatars2 = array();
55
+  private static $CheckedAvatars = [];
56
+  private static $CheckedAvatars2 = [];
57 57
 
58 58
   /**
59 59
    * Array of user IDs whose donor icons have been checked for size
60 60
    * @var array $CheckedDonorIcons
61 61
    */
62
-  private static $CheckedDonorIcons = array();
62
+  private static $CheckedDonorIcons = [];
63 63
 
64 64
   /**
65 65
    * Checks from our list of valid hosts

+ 3
- 3
classes/invite_tree.class.php View File

@@ -11,7 +11,7 @@ class INVITE_TREE {
11 11
   var $Visible = true;
12 12
 
13 13
   // Set things up
14
-  function INVITE_TREE($UserID, $Options = array()) {
14
+  function INVITE_TREE($UserID, $Options = []) {
15 15
     $this->UserID = $UserID;
16 16
     if ($Options['visible'] === false) {
17 17
       $this->Visible = false;
@@ -83,7 +83,7 @@ class INVITE_TREE {
83 83
     $TopLevelUpload = 0;
84 84
     $TopLevelDownload = 0;
85 85
 
86
-    $ClassSummary = array();
86
+    $ClassSummary = [];
87 87
     global $Classes;
88 88
     foreach ($Classes as $ClassID => $Val) {
89 89
       $ClassSummary[$ClassID] = 0;
@@ -164,7 +164,7 @@ class INVITE_TREE {
164 164
       This tree has <?=number_format($Count)?> entries, <?=number_format($Branches)?> branches, and a depth of <?=number_format($MaxTreeLevel - $OriginalTreeLevel)?>.
165 165
       It has
166 166
 <?
167
-      $ClassStrings = array();
167
+      $ClassStrings = [];
168 168
       foreach ($ClassSummary as $ClassID => $ClassCount) {
169 169
         if ($ClassCount == 0) {
170 170
           continue;

+ 4
- 4
classes/irc.class.php View File

@@ -17,9 +17,9 @@ abstract class IRC_BOT {
17 17
   protected $Socket = false;
18 18
   protected $Data = false;
19 19
   protected $Whois = false;
20
-  protected $Identified = array();
21
-  protected $Channels = array();
22
-  protected $Messages = array();
20
+  protected $Identified = [];
21
+  protected $Channels = [];
22
+  protected $Messages = [];
23 23
   protected $LastChan = false;
24 24
   protected $ListenSocket = false;
25 25
   protected $Listened = false;
@@ -176,7 +176,7 @@ abstract class IRC_BOT {
176 176
         }
177 177
       }
178 178
       G::$DB->LinkID = false;
179
-      G::$DB->Queries = array();
179
+      G::$DB->Queries = [];
180 180
     }
181 181
   }
182 182
 }

+ 2
- 2
classes/mass_user_bookmarks_editor.class.php View File

@@ -34,7 +34,7 @@ class MASS_USER_BOOKMARKS_EDITOR extends MASS_USER_TORRENTS_EDITOR {
34 34
    * Uses an IN() to match multiple items in one query.
35 35
    */
36 36
   public function mass_remove() {
37
-    $SQL = array();
37
+    $SQL = [];
38 38
     foreach ($_POST['remove'] as $GroupID => $K) {
39 39
       if (is_number($GroupID)) {
40 40
         $SQL[] = sprintf('%d', $GroupID);
@@ -58,7 +58,7 @@ class MASS_USER_BOOKMARKS_EDITOR extends MASS_USER_TORRENTS_EDITOR {
58 58
    * Uses $_POST['sort'] values to update the DB.
59 59
    */
60 60
   public function mass_update() {
61
-    $SQL = array();
61
+    $SQL = [];
62 62
     foreach ($_POST['sort'] as $GroupID => $Sort) {
63 63
       if (is_number($Sort) && is_number($GroupID)) {
64 64
         $SQL[] = sprintf('(%d, %d, %d)', $GroupID, $Sort, G::$LoggedUser['ID']);

+ 1
- 1
classes/mass_user_torrents_table_view.class.php View File

@@ -171,7 +171,7 @@ class MASS_USER_TORRENTS_TABLE_VIEW {
171 171
   public function body () {
172 172
     if ($this->HasTorrents)
173 173
       foreach ($this->TorrentList as $GroupID => $Group) {
174
-        $Artists = array();
174
+        $Artists = [];
175 175
 
176 176
         extract($Group);
177 177
         extract($this->CollageDataList[$GroupID]);

+ 11
- 11
classes/mediainfo.class.php View File

@@ -25,7 +25,7 @@ class ParseManager {
25 25
     public function __construct($string='') {
26 26
         $this->index = 0;
27 27
         $this->output = '';
28
-        $this->parsed_lines = array();
28
+        $this->parsed_lines = [];
29 29
         $this->set_string($string);
30 30
         $p = new SectionParser();
31 31
         $this->add_parser($p);
@@ -125,12 +125,12 @@ class ParseManager {
125 125
     }
126 126
 
127 127
     public function output_raw() {
128
-        $output = array();
128
+        $output = [];
129 129
         $sections = ['general', 'video', 'audio', 'text'];
130 130
 
131 131
         foreach($sections as $section) {
132 132
             if (isset($this->parsers[$section])) {
133
-                $output[$section] = array();
133
+                $output[$section] = [];
134 134
                 foreach($this->parsers[$section] as $index => $parser) {
135 135
                     $output[$section][$index] = $parser->output_raw();
136 136
                 }
@@ -162,7 +162,7 @@ class ParseManager {
162 162
 
163 163
     protected function new_mediainfo() {
164 164
         $this->output .= $this->output(false);
165
-        $this->parsed_lines = array();
165
+        $this->parsed_lines = [];
166 166
         foreach(array_keys($this->parsers) as $key) {
167 167
             if ($key != static::GENERIC_PARSER)
168 168
                 unset($this->parsers[$key]);
@@ -176,10 +176,10 @@ class SectionParser {
176 176
     protected $index;
177 177
 
178 178
 
179
-    public function __construct(&$lines=array(),&$i=0) {
179
+    public function __construct(&$lines=[],&$i=0) {
180 180
         $this->set_lines($lines,$i);
181 181
     }
182
-    public function set_lines(&$lines=array(),&$i=0){
182
+    public function set_lines(&$lines=[],&$i=0){
183 183
         $this->lines = &$lines;
184 184
         $this->index = &$i;
185 185
     }
@@ -277,7 +277,7 @@ class AudioSectionParser extends SectionParser {
277 277
     }
278 278
     public function output_raw() {
279 279
         $this->process_vars();
280
-        $output = array();
280
+        $output = [];
281 281
         $properties = [
282 282
             'audioformat', 'audiobitrate', 'audiochannels',
283 283
             'audiochannelpositions', 'audiotitle', 'audiolang', 'audioprofile',
@@ -400,7 +400,7 @@ class GeneralSectionParser extends SectionParser {
400 400
     }
401 401
     public function output_raw() {
402 402
         $this->process_vars();
403
-        $output = array();
403
+        $output = [];
404 404
         $properties = [
405 405
             'filename', 'generalformat', 'duration', 'filesize', 'form_codec',
406 406
             'form_releasegroup'
@@ -420,7 +420,7 @@ class GeneralSectionParser extends SectionParser {
420 420
                 $this->form_codec = '---';
421 421
                 break;
422 422
         }
423
-        $matches = array();
423
+        $matches = [];
424 424
         preg_match('/(?:^|.*\\|\/)\[(.*?)\].*$/',
425 425
             $this->filename, $matches);
426 426
         $this->form_releasegroup = $matches ? $matches[1] : '';
@@ -461,7 +461,7 @@ class TextSectionParser extends SectionParser {
461 461
     }
462 462
     public function output_raw() {
463 463
         $this->process_vars();
464
-        $output = array();
464
+        $output = [];
465 465
         $properties = [
466 466
             'title', 'language', 'format', 'default', 'processed_language',
467 467
             'form_format'
@@ -566,7 +566,7 @@ class VideoSectionParser extends SectionParser {
566 566
     }
567 567
     public function output_raw() {
568 568
         $this->process_vars();
569
-        $output = array();
569
+        $output = [];
570 570
         $properties = [
571 571
             'videoformat', 'videoformatversion', 'codec', 'width', 'height',
572 572
             'writinglibrary', 'frameratemode', 'framerate', 'aspectratio',

+ 8
- 8
classes/misc.class.php View File

@@ -173,7 +173,7 @@ class Misc {
173 173
     }
174 174
     list($AuthorName) = G::$DB->next_record();
175 175
 
176
-    $ThreadInfo = array();
176
+    $ThreadInfo = [];
177 177
     $ThreadInfo['IsLocked'] = 0;
178 178
     $ThreadInfo['IsSticky'] = 0;
179 179
 
@@ -242,14 +242,14 @@ class Misc {
242 242
         $Part1 = array_slice($Forum, 0, $Stickies, true); //Stickies
243 243
         $Part3 = array_slice($Forum, $Stickies, TOPICS_PER_PAGE - $Stickies - 1, true); //Rest of page
244 244
       } else {
245
-        $Part1 = array();
245
+        $Part1 = [];
246 246
         $Part3 = $Forum;
247 247
       }
248 248
       if (is_null($Part1)) {
249
-        $Part1 = array();
249
+        $Part1 = [];
250 250
       }
251 251
       if (is_null($Part3)) {
252
-        $Part3 = array();
252
+        $Part3 = [];
253 253
       }
254 254
       $Forum = $Part1 + $Part2 + $Part3;
255 255
       G::$Cache->cache_value("forums_$ForumID", array($Forum, '', 0, $Stickies), 0);
@@ -327,7 +327,7 @@ class Misc {
327 327
    * @return boolean true if (substring of) $Needle exists in $Haystack
328 328
    */
329 329
   public static function in_array_partial($Needle, $Haystack) {
330
-    static $Searches = array();
330
+    static $Searches = [];
331 331
     if (array_key_exists($Needle, $Searches)) {
332 332
       return $Searches[$Needle];
333 333
     }
@@ -381,7 +381,7 @@ class Misc {
381 381
    * @return array IDs
382 382
    */
383 383
   public static function get_tags($TagNames) {
384
-    $TagIDs = array();
384
+    $TagIDs = [];
385 385
     foreach ($TagNames as $Index => $TagName) {
386 386
       $Tag = G::$Cache->get_value("tag_id_$TagName");
387 387
       if (is_array($Tag)) {
@@ -469,7 +469,7 @@ class Misc {
469 469
    *  If array, it's a list of array keys not to escape.
470 470
    * @return mutated version of $Array with values escaped.
471 471
    */
472
-  public static function display_array($Array, $Escape = array()) {
472
+  public static function display_array($Array, $Escape = []) {
473 473
     foreach ($Array as $Key => $Val) {
474 474
       if ((!is_array($Escape) && $Escape == true) || !in_array($Key, $Escape)) {
475 475
         $Array[$Key] = display_str($Val);
@@ -484,7 +484,7 @@ class Misc {
484 484
    * @return array of results
485 485
    */
486 486
   public static function search_array($Array, $Key, $Value) {
487
-    $Results = array();
487
+    $Results = [];
488 488
     if (is_array($Array))
489 489
     {
490 490
       if (isset($Array[$Key]) && $Array[$Key] == $Value) {

+ 7
- 7
classes/mysql.class.php View File

@@ -131,7 +131,7 @@ function db_string($String, $DisableWildcards = false) {
131 131
   return $String;
132 132
 }
133 133
 
134
-function db_array($Array, $DontEscape = array(), $Quote = false) {
134
+function db_array($Array, $DontEscape = [], $Quote = false) {
135 135
   foreach ($Array as $Key => $Val) {
136 136
     if (!in_array($Key, $DontEscape)) {
137 137
       if ($Quote) {
@@ -148,12 +148,12 @@ function db_array($Array, $DontEscape = array(), $Quote = false) {
148 148
 class DB_MYSQL {
149 149
   public $LinkID = false;
150 150
   protected $QueryID = false;
151
-  protected $Record = array();
151
+  protected $Record = [];
152 152
   protected $Row;
153 153
   protected $Errno = 0;
154 154
   protected $Error = '';
155 155
 
156
-  public $Queries = array();
156
+  public $Queries = [];
157 157
   public $Time = 0.0;
158 158
 
159 159
   protected $Database = '';
@@ -352,7 +352,7 @@ class DB_MYSQL {
352 352
   // If $Key is set, use the $Key column in the result set as the array key
353 353
   // Otherwise, use an integer
354 354
   function to_array($Key = false, $Type = MYSQLI_BOTH, $Escape = true) {
355
-    $Return = array();
355
+    $Return = [];
356 356
     while ($Row = mysqli_fetch_array($this->QueryID, $Type)) {
357 357
       if ($Escape !== false) {
358 358
         $Row = Misc::display_array($Row, $Escape);
@@ -369,7 +369,7 @@ class DB_MYSQL {
369 369
 
370 370
   //  Loops through the result set, collecting the $ValField column into an array with $KeyField as keys
371 371
   function to_pair($KeyField, $ValField, $Escape = true) {
372
-    $Return = array();
372
+    $Return = [];
373 373
     while ($Row = mysqli_fetch_array($this->QueryID)) {
374 374
       if ($Escape) {
375 375
         $Key = display_str($Row[$KeyField]);
@@ -386,7 +386,7 @@ class DB_MYSQL {
386 386
 
387 387
   //  Loops through the result set, collecting the $Key column into an array
388 388
   function collect($Key, $Escape = true) {
389
-    $Return = array();
389
+    $Return = [];
390 390
     while ($Row = mysqli_fetch_array($this->QueryID)) {
391 391
       $Return[] = $Escape ? display_str($Row[$Key]) : $Row[$Key];
392 392
     }
@@ -413,7 +413,7 @@ class DB_MYSQL {
413 413
    * and stores them in $this->Queries.
414 414
    */
415 415
   function warnings() {
416
-    $Warnings = array();
416
+    $Warnings = [];
417 417
     if (!is_bool($this->LinkID) && mysqli_warning_count($this->LinkID)) {
418 418
       $e = mysqli_get_warnings($this->LinkID);
419 419
       do {

+ 11
- 11
classes/notificationsmanager.class.php View File

@@ -58,9 +58,9 @@ class NotificationsManager {
58 58
   private $Settings;
59 59
   private $Skipped;
60 60
 
61
-  function __construct($UserID, $Skip = array(), $Load = true, $AutoSkip = true) {
61
+  function __construct($UserID, $Skip = [], $Load = true, $AutoSkip = true) {
62 62
     $this->UserID = $UserID;
63
-    $this->Notifications = array();
63
+    $this->Notifications = [];
64 64
     $this->Settings = self::get_settings($UserID);
65 65
     $this->Skipped = $Skip;
66 66
     if ($AutoSkip) {
@@ -110,7 +110,7 @@ class NotificationsManager {
110 110
 
111 111
   public function clear_notifications_array() {
112 112
     unset($this->Notifications);
113
-    $this->Notifications = array();
113
+    $this->Notifications = [];
114 114
   }
115 115
 
116 116
   private function create_notification($Type, $ID, $Message, $URL, $Importance) {
@@ -139,7 +139,7 @@ class NotificationsManager {
139 139
         FROM users_notifications_settings
140 140
         WHERE $Type != 0
141 141
           AND UserID IN ($UserIDs)");
142
-      $UserIDs = array();
142
+      $UserIDs = [];
143 143
       while (list($ID) = G::$DB->next_record()) {
144 144
         $UserIDs[] = $ID;
145 145
       }
@@ -147,7 +147,7 @@ class NotificationsManager {
147 147
       foreach ($UserIDs as $UserID) {
148 148
         $OneReads = G::$Cache->get_value("notifications_one_reads_$UserID");
149 149
         if (!$OneReads) {
150
-          $OneReads = array();
150
+          $OneReads = [];
151 151
         }
152 152
         array_unshift($OneReads, $this->create_notification($OneReads, "oneread_" . uniqid(), null, $Message, $URL, $Importance));
153 153
         $OneReads = array_filter($OneReads);
@@ -170,7 +170,7 @@ class NotificationsManager {
170 170
       FROM users_notifications_settings
171 171
       WHERE $Type != 0
172 172
         $UserWhere");
173
-    $IDs = array();
173
+    $IDs = [];
174 174
     while (list($ID) = G::$DB->next_record()) {
175 175
       $IDs[] = $ID;
176 176
     }
@@ -496,7 +496,7 @@ class NotificationsManager {
496 496
       FROM staff_pm_conversations
497 497
       WHERE Unread = true
498 498
         AND UserID = " . G::$LoggedUser['ID']);
499
-    $IDs = array();
499
+    $IDs = [];
500 500
     while (list($ID) = G::$DB->next_record()) {
501 501
       $IDs[] = $ID;
502 502
     }
@@ -518,7 +518,7 @@ class NotificationsManager {
518 518
       FROM pm_conversations_users
519 519
       WHERE Unread = '1'
520 520
         AND UserID = " . G::$LoggedUser['ID']);
521
-    $IDs = array();
521
+    $IDs = [];
522 522
     while (list($ID) = G::$DB->next_record()) {
523 523
       $IDs[] = $ID;
524 524
     }
@@ -541,7 +541,7 @@ class NotificationsManager {
541 541
       FROM users_notify_torrents
542 542
       WHERE UserID = ' " . G::$LoggedUser['ID'] . "'
543 543
         AND UnRead = '1'");
544
-    $IDs = array();
544
+    $IDs = [];
545 545
     while (list($ID) = G::$DB->next_record()) {
546 546
       $IDs[] = $ID;
547 547
     }
@@ -606,7 +606,7 @@ class NotificationsManager {
606 606
   public static function send_notification($UserID, $ID, $Type, $Message, $URL, $Importance = 'alert', $AutoExpire = false) {
607 607
     $Notifications = G::$Cache->get_value("user_cache_notifications_$UserID");
608 608
     if (empty($Notifications)) {
609
-      $Notifications = array();
609
+      $Notifications = [];
610 610
     }
611 611
     array_unshift($Notifications, $this->create_notification($Type, $ID, $Message, $URL, $Importance, $AutoExpire));
612 612
     G::$Cache->cache_value("user_cache_notifications_$UserID", $Notifications, 0);
@@ -644,7 +644,7 @@ class NotificationsManager {
644 644
       // A little cheat technique, gets all keys in the $_POST array starting with 'notifications_'
645 645
       $Settings = array_intersect_key($_POST, array_flip(preg_grep('/^notifications_/', array_keys($_POST))));
646 646
     }
647
-    $Update = array();
647
+    $Update = [];
648 648
     foreach (self::$Types as $Type) {
649 649
       $Popup = array_key_exists("notifications_{$Type}_popup", $Settings);
650 650
       $Traditional = array_key_exists("notifications_{$Type}_traditional", $Settings);

+ 1
- 1
classes/paranoia.class.php View File

@@ -54,7 +54,7 @@ function check_paranoia($Property, $Paranoia, $UserClass, $UserID = false) {
54 54
     $Paranoia = json_decode($Paranoia, true);
55 55
   }
56 56
   if (!is_array($Paranoia)) {
57
-    $Paranoia = array();
57
+    $Paranoia = [];
58 58
   }
59 59
   if (is_array($Property)) {
60 60
     $all = true;

+ 2
- 2
classes/permissions.class.php View File

@@ -74,7 +74,7 @@ class Permissions {
74 74
     $Permissions = self::get_permissions($UserInfo['PermissionID']);
75 75
 
76 76
     // Manage 'special' inherited permissions
77
-    $BonusPerms = array();
77
+    $BonusPerms = [];
78 78
     $BonusCollages = 0;
79 79
     foreach ($UserInfo['ExtraClasses'] as $PermID => $Value) {
80 80
       $ClassPerms = self::get_permissions($PermID);
@@ -84,7 +84,7 @@ class Permissions {
84 84
     }
85 85
 
86 86
     if (empty($CustomPermissions)) {
87
-      $CustomPermissions = array();
87
+      $CustomPermissions = [];
88 88
     }
89 89
 
90 90
     $MaxCollages = $Permissions['Permissions']['MaxCollages'] + $BonusCollages;

+ 8
- 8
classes/requests.class.php View File

@@ -75,7 +75,7 @@ class Requests {
75 75
     }
76 76
     // Make sure there's something in $RequestIDs, otherwise the SQL will break
77 77
     if (count($RequestIDs) === 0) {
78
-      return array();
78
+      return [];
79 79
     }
80 80
     $IDs = implode(',', array_keys($NotFound));
81 81
 
@@ -111,7 +111,7 @@ class Requests {
111 111
       $Tags = self::get_tags(G::$DB->collect('ID', false));
112 112
       foreach ($Requests as $Request) {
113 113
         unset($NotFound[$Request['ID']]);
114
-        $Request['Tags'] = isset($Tags[$Request['ID']]) ? $Tags[$Request['ID']] : array();
114
+        $Request['Tags'] = isset($Tags[$Request['ID']]) ? $Tags[$Request['ID']] : [];
115 115
         $Found[$Request['ID']] = $Request;
116 116
         G::$Cache->cache_value('request_'.$Request['ID'], $Request, 0);
117 117
       }
@@ -149,7 +149,7 @@ class Requests {
149 149
     if (is_array($Artists)) {
150 150
       $Results = $Artists;
151 151
     } else {
152
-      $Results = array();
152
+      $Results = [];
153 153
       $QueryID = G::$DB->get_query_id();
154 154
       G::$DB->query("
155 155
         SELECT
@@ -172,7 +172,7 @@ class Requests {
172 172
 
173 173
   public static function get_tags($RequestIDs) {
174 174
     if (empty($RequestIDs)) {
175
-      return array();
175
+      return [];
176 176
     }
177 177
     if (is_array($RequestIDs)) {
178 178
       $RequestIDs = implode(',', $RequestIDs);
@@ -189,7 +189,7 @@ class Requests {
189 189
       ORDER BY rt.TagID ASC");
190 190
     $Tags = G::$DB->to_array(false, MYSQLI_NUM, false);
191 191
     G::$DB->set_query_id($QueryID);
192
-    $Results = array();
192
+    $Results = [];
193 193
     foreach ($Tags as $TagsRow) {
194 194
       list($RequestID, $TagID, $TagName) = $TagsRow;
195 195
       $Results[$RequestID][$TagID] = $TagName;
@@ -213,16 +213,16 @@ class Requests {
213 213
       if (!G::$DB->has_results()) {
214 214
         return array(
215 215
           'TotalBounty' => 0,
216
-          'Voters' => array());
216
+          'Voters' => []);
217 217
       }
218 218
       $Votes = G::$DB->to_array();
219 219
 
220
-      $RequestVotes = array();
220
+      $RequestVotes = [];
221 221
       $RequestVotes['TotalBounty'] = array_sum(G::$DB->collect('Bounty'));
222 222
 
223 223
       foreach ($Votes as $Vote) {
224 224
         list($UserID, $Bounty, $Username) = $Vote;
225
-        $VoteArray = array();
225
+        $VoteArray = [];
226 226
         $VotesArray[] = array('UserID' => $UserID, 'Username' => $Username, 'Bounty' => $Bounty);
227 227
       }
228 228
 

+ 1
- 1
classes/sitehistory.class.php View File

@@ -107,7 +107,7 @@ class SiteHistory {
107 107
     $SubCategory = (int)$SubCategory;
108 108
     $Tags = db_string($Tags);
109 109
     $Limit = (int)$Limit;
110
-    $Where = array();
110
+    $Where = [];
111 111
     if (!empty($Month)) {
112 112
       $Where[] = " MONTH(Date) = '$Month' ";
113 113
     }

+ 2
- 2
classes/sphinxql.class.php View File

@@ -4,14 +4,14 @@ if (!extension_loaded('mysqli')) {
4 4
 }
5 5
 
6 6
 class Sphinxql extends mysqli {
7
-  private static $Connections = array();
7
+  private static $Connections = [];
8 8
   private $Server;
9 9
   private $Port;
10 10
   private $Socket;
11 11
   private $Ident;
12 12
   private $Connected = false;
13 13
 
14
-  public static $Queries = array();
14
+  public static $Queries = [];
15 15
   public static $Time = 0.0;
16 16
 
17 17
 

+ 8
- 8
classes/sphinxqlquery.class.php View File

@@ -61,7 +61,7 @@ class SphinxqlQuery {
61 61
       $this->error("Attribute name and filter value are required.");
62 62
       return $this;
63 63
     }
64
-    $Filters = array();
64
+    $Filters = [];
65 65
     if (is_array($Values)) {
66 66
       foreach ($Values as $Value) {
67 67
         if (!is_number($Value)) {
@@ -172,7 +172,7 @@ class SphinxqlQuery {
172 172
    */
173 173
   public function order_by($Attribute = false, $Mode = false) {
174 174
     if (empty($Attribute)) {
175
-      $this->SortBy = array();
175
+      $this->SortBy = [];
176 176
     } else {
177 177
       $this->SortBy[] = "$Attribute $Mode";
178 178
     }
@@ -244,7 +244,7 @@ class SphinxqlQuery {
244 244
    * @return string of options
245 245
    */
246 246
   private function build_options() {
247
-    $Options = array();
247
+    $Options = [];
248 248
     foreach ($this->Options as $Option => $Value) {
249 249
       $Options[] = "$Option = $Value";
250 250
     }
@@ -346,16 +346,16 @@ class SphinxqlQuery {
346 346
    * Reset all query options and conditions
347 347
    */
348 348
   public function reset() {
349
-    $this->Errors = array();
350
-    $this->Expressions = array();
351
-    $this->Filters = array();
349
+    $this->Errors = [];
350
+    $this->Expressions = [];
351
+    $this->Filters = [];
352 352
     $this->GroupBy = '';
353 353
     $this->Indexes = '';
354
-    $this->Limits = array();
354
+    $this->Limits = [];
355 355
     $this->Options = array('ranker' => 'none');
356 356
     $this->QueryString = '';
357 357
     $this->Select = '*';
358
-    $this->SortBy = array();
358
+    $this->SortBy = [];
359 359
     $this->SortGroupBy = '';
360 360
   }
361 361
 

+ 5
- 5
classes/sphinxqlresult.class.php View File

@@ -47,7 +47,7 @@ class SphinxqlResult {
47 47
    * @return array with the $Key value of all results
48 48
    */
49 49
   public function collect($Key) {
50
-    $Return = array();
50
+    $Return = [];
51 51
     while ($Row = $this->fetch_array()) {
52 52
       $Return[] = $Row[$Key];
53 53
     }
@@ -63,7 +63,7 @@ class SphinxqlResult {
63 63
    * @return array with all available data for the matches
64 64
    */
65 65
   public function to_array($Key, $ResultType = MYSQLI_ASSOC) {
66
-    $Return = array();
66
+    $Return = [];
67 67
     while ($Row = $this->fetch_array($ResultType)) {
68 68
       if ($Key !== false) {
69 69
         $Return[$Row[$Key]] = $Row;
@@ -83,7 +83,7 @@ class SphinxqlResult {
83 83
    * @return array with $Key1 => $Key2 pairs for matches
84 84
    */
85 85
   public function to_pair($Key1, $Key2) {
86
-    $Return = array();
86
+    $Return = [];
87 87
     while ($Row = $this->fetch_array()) {
88 88
       $Return[$Row[$Key1]] = $Row[$Key2];
89 89
     }
@@ -100,7 +100,7 @@ class SphinxqlResult {
100 100
   public function get_meta($Keys = false) {
101 101
     if ($Keys !== false) {
102 102
       if (is_array($Keys)) {
103
-        $Return = array();
103
+        $Return = [];
104 104
         foreach ($Keys as $Key) {
105 105
           if (!isset($this->Meta[$Key])) {
106 106
             continue;
@@ -125,7 +125,7 @@ class SphinxqlResult {
125 125
   public function get_result_info($Keys = false) {
126 126
     if ($Keys !== false) {
127 127
       if (is_array($Keys)) {
128
-        $Return = array();
128
+        $Return = [];
129 129
         foreach ($Keys as $Key) {
130 130
           if (!isset($this->Result->$Key)) {
131 131
             continue;

+ 2
- 2
classes/subscriptions.class.php View File

@@ -17,11 +17,11 @@ class Subscriptions {
17 17
      * different Page are: forums: TopicID artist: ArtistID collages:
18 18
      * CollageID requests: RequestID torrents: GroupID
19 19
      */
20
-    $Matches = array();
20
+    $Matches = [];
21 21
     preg_match_all('/\[quote(?:=(.*)(?:\|.*)?)?]|\[\/quote]/iU', $Body, $Matches, PREG_SET_ORDER);
22 22
 
23 23
     if (count($Matches)) {
24
-      $Usernames = array();
24
+      $Usernames = [];
25 25
       $Level = 0;
26 26
       foreach ($Matches as $M) {
27 27
         if ($M[0] != '[/quote]') {

+ 3
- 3
classes/tags.class.php View File

@@ -30,7 +30,7 @@ class Tags {
30 30
    * @static
31 31
    * @var array $All Class Tags
32 32
    */
33
-  private static $All = array();
33
+  private static $All = [];
34 34
 
35 35
   /**
36 36
    * All tags in the current instance
@@ -41,7 +41,7 @@ class Tags {
41 41
   /**
42 42
    * @var array $TagLink Tag link list
43 43
    */
44
-  private $TagLink = array();
44
+  private $TagLink = [];
45 45
 
46 46
   /**
47 47
    * @var string $Primary The primary tag
@@ -66,7 +66,7 @@ class Tags {
66 66
       $this->Primary = $this->Tags[0];
67 67
       sort($this->Tags);
68 68
     } else {
69
-      $this->Tags = array();
69
+      $this->Tags = [];
70 70
     }
71 71
   }
72 72
 

+ 1
- 1
classes/templates.class.php View File

@@ -7,7 +7,7 @@
7 7
 
8 8
 class TEMPLATE {
9 9
   var $file = '';
10
-  var $vars = array();
10
+  var $vars = [];
11 11
 
12 12
   function open($file) {
13 13
     $this->file = file($file);

+ 4
- 4
classes/testing.class.php View File

@@ -2,7 +2,7 @@
2 2
 
3 3
 class Testing {
4 4
   private static $ClassDirectories = array("classes");
5
-  private static $Classes = array();
5
+  private static $Classes = [];
6 6
 
7 7
   /**
8 8
    * Initialize the testasble classes into a map keyed by class name
@@ -87,7 +87,7 @@ class Testing {
87 87
       $ReflectionClass = $Class;
88 88
     }
89 89
     $ReflectionMethods = $ReflectionClass->getMethods();
90
-    $TestableMethods = array();
90
+    $TestableMethods = [];
91 91
     foreach($ReflectionMethods as $Method) {
92 92
       if ($Method->isPublic() && $Method->isStatic() && strpos($Method->getDocComment(), "@Test")) {
93 93
         $TestableMethods[] = $Method;
@@ -110,7 +110,7 @@ class Testing {
110 110
    */
111 111
   public static function get_undocumented_methods($Class) {
112 112
     $ReflectionClass = self::$Classes[$Class];
113
-    $Methods = array();
113
+    $Methods = [];
114 114
     foreach($ReflectionClass->getMethods() as $Method) {
115 115
       if (!$Method->getDocComment()) {
116 116
         $Methods[] = $Method;
@@ -124,7 +124,7 @@ class Testing {
124 124
    */
125 125
   public static function get_documented_methods($Class)  {
126 126
     $ReflectionClass = self::$Classes[$Class];
127
-    $Methods = array();
127
+    $Methods = [];
128 128
     foreach($ReflectionClass->getMethods() as $Method) {
129 129
       if ($Method->getDocComment()) {
130 130
         $Methods[] = $Method;

+ 4
- 4
classes/text.class.php View File

@@ -125,7 +125,7 @@ class Text {
125 125
    * Processed version of the $Smileys array, see {@link smileys}
126 126
    * @var array $ProcessedSmileys
127 127
    */
128
-  private static $ProcessedSmileys = array();
128
+  private static $ProcessedSmileys = [];
129 129
 
130 130
   /**
131 131
    * Whether or not to turn images into URLs (used inside [quote] tags).
@@ -202,7 +202,7 @@ class Text {
202 202
     global $Debug;
203 203
     $Debug->set_flag('BBCode start');
204 204
     $Str = display_str($Str);
205
-    self::$Headlines = array();
205
+    self::$Headlines = [];
206 206
 
207 207
     $Str = preg_replace('/\[\\[(ch|uch)]\]/i', '', $Str);
208 208
     $Str = preg_replace('/\[ch\]/i', '[ch][/ch]', $Str);
@@ -344,7 +344,7 @@ class Text {
344 344
   private static function parse($Str) {
345 345
     $i = 0; // Pointer to keep track of where we are in $Str
346 346
     $Len = strlen($Str);
347
-    $Array = array();
347
+    $Array = [];
348 348
     $ArrayPos = 0;
349 349
     $StrLC = strtolower($Str);
350 350
 
@@ -721,7 +721,7 @@ class Text {
721 721
           break;
722 722
         case 'torrent':
723 723
           $Pattern = '/('.SITE_DOMAIN.'\/torrents\.php.*[\?&]id=)?(\d+)($|&|\#).*/i';
724
-          $Matches = array();
724
+          $Matches = [];
725 725
           if (preg_match($Pattern, $Block['Val'], $Matches)) {
726 726
             if (isset($Matches[2])) {
727 727
               $GroupID = $Matches[2];

+ 3
- 3
classes/textarea_preview.class.php View File

@@ -14,7 +14,7 @@ class TEXTAREA_PREVIEW_SUPER {
14 14
    * @static
15 15
    * @var array $_ID Array of textarea IDs
16 16
    */
17
-  protected static $_ID = array();
17
+  protected static $_ID = [];
18 18
 
19 19
   /**
20 20
    * @static
@@ -56,7 +56,7 @@ class TEXTAREA_PREVIEW_SUPER {
56 56
    * @return void
57 57
    */
58 58
   private static function iterator() {
59
-    $script = array();
59
+    $script = [];
60 60
     for ($i = 0; $i < self::$Textareas; $i++) {
61 61
       if (isset(self::$_ID[$i]) && is_string(self::$_ID[$i])) {
62 62
         $a = sprintf('%d, "%s"', $i, self::$_ID[$i]);
@@ -149,7 +149,7 @@ class TEXTAREA_PREVIEW extends TEXTAREA_PREVIEW_SUPER {
149 149
    */
150 150
   public function __construct($Name, $ID = '', $Value = '', $Cols = 50, $Rows = 10,
151 151
     $Preview = true, $Buttons = true, $Buffer = false,
152
-    array $ExtraAttributes = array()
152
+    array $ExtraAttributes = []
153 153
   ) {
154 154
     $this->id = parent::$Textareas;
155 155
     parent::$Textareas += 1;

+ 1
- 1
classes/tools.class.php View File

@@ -60,7 +60,7 @@ class Tools {
60 60
    * @return the country of origin
61 61
    */
62 62
   public static function geoip($IP) {
63
-    static $IPs = array();
63
+    static $IPs = [];
64 64
     if (isset($IPs[$IP])) {
65 65
       return $IPs[$IP];
66 66
     }

+ 4
- 4
classes/torrent.class.php View File

@@ -237,7 +237,7 @@ class TORRENT extends BENCODE_DICT {
237 237
   }
238 238
 
239 239
   function set_announce_list($UrlsList) {
240
-    $AnnounceList = new BENCODE_LIST(array(), true);
240
+    $AnnounceList = new BENCODE_LIST([], true);
241 241
     foreach ($UrlsList as $Urls) {
242 242
       $SubList = new BENCODE_LIST($Urls, true);
243 243
       unset($SubList->Str);
@@ -255,13 +255,13 @@ class TORRENT extends BENCODE_DICT {
255 255
   //  * the files in the torrent
256 256
   //  * the total size of files described therein
257 257
   function file_list() {
258
-    $FileList = array();
258
+    $FileList = [];
259 259
     if (!isset($this->Val['info']->Val['files'])) { // Single file mode
260 260
       $TotalSize = $this->Val['info']->Val['length'];
261 261
       $FileList[] = array($TotalSize, $this->get_name());
262 262
     } else { // Multiple file mode
263
-      $FileNames = array();
264
-      $FileSizes = array();
263
+      $FileNames = [];
264
+      $FileSizes = [];
265 265
       $TotalSize = 0;
266 266
       $Files = $this->Val['info']->Val['files']->Val;
267 267
       if (isset($Files[0]->Val['path.utf-8'])) {

+ 3
- 3
classes/torrent_32bit.class.php View File

@@ -248,13 +248,13 @@ class TORRENT extends BENCODE_DICT {
248 248
   //  * the files in the torrent
249 249
   //  * the total size of files described therein
250 250
   function file_list() {
251
-    $FileList = array();
251
+    $FileList = [];
252 252
     if (!isset($this->Val['info']->Val['files'])) { // Single file mode
253 253
       $TotalSize = substr($this->Val['info']->Val['length'],7);
254 254
       $FileList[] = array($TotalSize, $this->get_name());
255 255
     } else { // Multiple file mode
256
-      $FileNames = array();
257
-      $FileSizes = array();
256
+      $FileNames = [];
257
+      $FileSizes = [];
258 258
       $TotalSize = 0;
259 259
       $Files = $this->Val['info']->Val['files']->Val;
260 260
       if (isset($Files[0]->Val['path.utf-8'])) {

+ 14
- 14
classes/torrent_form.class.php View File

@@ -14,21 +14,21 @@
14 14
 
15 15
 class TORRENT_FORM {
16 16
   var $UploadForm = '';
17
-  var $Categories = array();
18
-  var $Formats = array();
19
-  var $Bitrates = array();
20
-  var $Media = array();
21
-  var $MediaManaga = array();
22
-  var $Containers = array();
23
-  var $ContainersGames = array();
24
-  var $Codecs = array();
25
-  var $Resolutions = array();
26
-  var $AudioFormats = array();
27
-  var $Subbing = array();
28
-  var $Languages = array();
29
-  var $Platform = array();
17
+  var $Categories = [];
18
+  var $Formats = [];
19
+  var $Bitrates = [];
20
+  var $Media = [];
21
+  var $MediaManaga = [];
22
+  var $Containers = [];
23
+  var $ContainersGames = [];
24
+  var $Codecs = [];
25
+  var $Resolutions = [];
26
+  var $AudioFormats = [];
27
+  var $Subbing = [];
28
+  var $Languages = [];
29
+  var $Platform = [];
30 30
   var $NewTorrent = false;
31
-  var $Torrent = array();
31
+  var $Torrent = [];
32 32
   var $Error = false;
33 33
   var $TorrentID = false;
34 34
   var $Disabled = '';

+ 20
- 20
classes/torrents.class.php View File

@@ -64,7 +64,7 @@ class Torrents {
64 64
     }
65 65
     // Make sure there's something in $GroupIDs, otherwise the SQL will break
66 66
     if (count($GroupIDs) === 0) {
67
-      return array();
67
+      return [];
68 68
     }
69 69
 
70 70
     /*
@@ -77,7 +77,7 @@ class Torrents {
77 77
 
78 78
     if (count($NotFound) > 0) {
79 79
       $IDs = implode(',', array_keys($NotFound));
80
-      $NotFound = array();
80
+      $NotFound = [];
81 81
       $QueryID = G::$DB->get_query_id();
82 82
       G::$DB->query("
83 83
         SELECT
@@ -87,8 +87,8 @@ class Torrents {
87 87
 
88 88
       while ($Group = G::$DB->next_record(MYSQLI_ASSOC, true)) {
89 89
         $NotFound[$Group['ID']] = $Group;
90
-        $NotFound[$Group['ID']]['Torrents'] = array();
91
-        $NotFound[$Group['ID']]['Artists'] = array();
90
+        $NotFound[$Group['ID']]['Torrents'] = [];
91
+        $NotFound[$Group['ID']]['Artists'] = [];
92 92
       }
93 93
       G::$DB->set_query_id($QueryID);
94 94
 
@@ -101,7 +101,7 @@ class Torrents {
101 101
 
102 102
       while ($Screenshot = G::$DB->next_record(MYSQLI_ASSOC, true)) {
103 103
         if (!isset($NotFound[$Screenshot['GroupID']]['Screenshots']))
104
-          $NotFound[$Screenshot['GroupID']]['Screenshots'] = array();
104
+          $NotFound[$Screenshot['GroupID']]['Screenshots'] = [];
105 105
         $NotFound[$Screenshot['GroupID']]['Screenshots'][] = $Screenshot;
106 106
       }
107 107
 
@@ -138,7 +138,7 @@ class Torrents {
138 138
     if ($GetArtists) {
139 139
       $Artists = Artists::get_artists($GroupIDs);
140 140
     } else {
141
-      $Artists = array();
141
+      $Artists = [];
142 142
     }
143 143
 
144 144
     if ($Return) { // If we're interested in the data, and not just caching it
@@ -659,7 +659,7 @@ class Torrents {
659 659
    * @param boolean $ShowEdition if false, RemasterYear/RemasterTitle will be omitted
660 660
    */
661 661
   public static function torrent_info($Data, $ShowMedia = true, $ShowEdition = false, $HTMLy = true) {
662
-    $Info = array();
662
+    $Info = [];
663 663
     if ($ShowMedia && !empty($Data['Media'])) {
664 664
       $Info[] = $Data['Media'];
665 665
     }
@@ -865,7 +865,7 @@ class Torrents {
865 865
     $Buckets = 64;
866 866
     $LastBucket = $Buckets - 1;
867 867
     $BucketID = $TorrentID & $LastBucket;
868
-    static $SnatchedTorrents = array(), $UpdateTime = array();
868
+    static $SnatchedTorrents = [], $UpdateTime = [];
869 869
 
870 870
     if (empty($SnatchedTorrents)) {
871 871
       $SnatchedTorrents = array_fill(0, $Buckets, false);
@@ -886,11 +886,11 @@ class Torrents {
886 886
       // This bucket hasn't been checked before
887 887
       $CurSnatchedTorrents = G::$Cache->get_value("users_snatched_{$UserID}_$BucketID", true);
888 888
       if ($CurSnatchedTorrents === false || $CurTime > $UpdateTime['next']) {
889
-        $Updated = array();
889
+        $Updated = [];
890 890
         $QueryID = G::$DB->get_query_id();
891 891
         if ($CurSnatchedTorrents === false || $UpdateTime['last'] == 0) {
892 892
           for ($i = 0; $i < $Buckets; $i++) {
893
-            $SnatchedTorrents[$i] = array();
893
+            $SnatchedTorrents[$i] = [];
894 894
           }
895 895
           // Not found in cache. Since we don't have a suitable index, it's faster to update everything
896 896
           G::$DB->query("
@@ -916,7 +916,7 @@ class Torrents {
916 916
             if ($SnatchedTorrents[$CurBucketID] === false) {
917 917
               $SnatchedTorrents[$CurBucketID] = G::$Cache->get_value("users_snatched_{$UserID}_$CurBucketID", true);
918 918
               if ($SnatchedTorrents[$CurBucketID] === false) {
919
-                $SnatchedTorrents[$CurBucketID] = array();
919
+                $SnatchedTorrents[$CurBucketID] = [];
920 920
               }
921 921
             }
922 922
             $SnatchedTorrents[$CurBucketID][(int)$ID] = true;
@@ -946,7 +946,7 @@ class Torrents {
946 946
     $Buckets = 64;
947 947
     $LastBucket = $Buckets - 1;
948 948
     $BucketID = $TorrentID & $LastBucket;
949
-    static $SeedingTorrents = array(), $UpdateTime = array();
949
+    static $SeedingTorrents = [], $UpdateTime = [];
950 950
 
951 951
     if (empty($SeedingTorrents)) {
952 952
       $SeedingTorrents = array_fill(0, $Buckets, false);
@@ -967,11 +967,11 @@ class Torrents {
967 967
       // This bucket hasn't been checked before
968 968
       $CurSeedingTorrents = G::$Cache->get_value("users_seeding_{$UserID}_$BucketID", true);
969 969
       if ($CurSeedingTorrents === false || $CurTime > $UpdateTime['next']) {
970
-        $Updated = array();
970
+        $Updated = [];
971 971
         $QueryID = G::$DB->get_query_id();
972 972
         if ($CurSeedingTorrents === false || $UpdateTime['last'] == 0) {
973 973
           for ($i = 0; $i < $Buckets; $i++) {
974
-            $SeedingTorrents[$i] = array();
974
+            $SeedingTorrents[$i] = [];
975 975
           }
976 976
           // Not found in cache. Since we don't have a suitable index, it's faster to update everything
977 977
           G::$DB->query("
@@ -1001,7 +1001,7 @@ class Torrents {
1001 1001
             if ($SeedingTorrents[$CurBucketID] === false) {
1002 1002
               $SeedingTorrents[$CurBucketID] = G::$Cache->get_value("users_seeding_{$UserID}_$CurBucketID", true);
1003 1003
               if ($SeedingTorrents[$CurBucketID] === false) {
1004
-                $SeedingTorrents[$CurBucketID] = array();
1004
+                $SeedingTorrents[$CurBucketID] = [];
1005 1005
               }
1006 1006
             }
1007 1007
             $SeedingTorrents[$CurBucketID][(int)$ID] = true;
@@ -1032,7 +1032,7 @@ class Torrents {
1032 1032
     $Buckets = 64;
1033 1033
     $LastBucket = $Buckets - 1;
1034 1034
     $BucketID = $TorrentID & $LastBucket;
1035
-    static $LeechingTorrents = array(), $UpdateTime = array();
1035
+    static $LeechingTorrents = [], $UpdateTime = [];
1036 1036
 
1037 1037
     if (empty($LeechingTorrents)) {
1038 1038
       $LeechingTorrents = array_fill(0, $Buckets, false);
@@ -1053,11 +1053,11 @@ class Torrents {
1053 1053
       // This bucket hasn't been checked before
1054 1054
       $CurLeechingTorrents = G::$Cache->get_value("users_leeching_{$UserID}_$BucketID", true);
1055 1055
       if ($CurLeechingTorrents === false || $CurTime > $UpdateTime['next']) {
1056
-        $Updated = array();
1056
+        $Updated = [];
1057 1057
         $QueryID = G::$DB->get_query_id();
1058 1058
         if ($CurLeechingTorrents === false || $UpdateTime['last'] == 0) {
1059 1059
           for ($i = 0; $i < $Buckets; $i++) {
1060
-            $LeechingTorrents[$i] = array();
1060
+            $LeechingTorrents[$i] = [];
1061 1061
           }
1062 1062
           // Not found in cache. Since we don't have a suitable index, it's faster to update everything
1063 1063
           G::$DB->query("
@@ -1087,7 +1087,7 @@ class Torrents {
1087 1087
             if ($LeechingTorrents[$CurBucketID] === false) {
1088 1088
               $LeechingTorrents[$CurBucketID] = G::$Cache->get_value("users_leeching_{$UserID}_$CurBucketID", true);
1089 1089
               if ($LeechingTorrents[$CurBucketID] === false) {
1090
-                $LeechingTorrents[$CurBucketID] = array();
1090
+                $LeechingTorrents[$CurBucketID] = [];
1091 1091
               }
1092 1092
             }
1093 1093
             $LeechingTorrents[$CurBucketID][(int)$ID] = true;
@@ -1238,7 +1238,7 @@ class Torrents {
1238 1238
       G::$Cache->cache_value("reports_torrent_$TorrentID", $Reports, 0);
1239 1239
     }
1240 1240
     if (!check_perms('admin_reports')) {
1241
-      $Return = array();
1241
+      $Return = [];
1242 1242
       foreach ($Reports as $Report) {
1243 1243
         if ($Report['Type'] !== 'edited') {
1244 1244
           $Return[] = $Report;

+ 5
- 5
classes/torrentsdl.class.php View File

@@ -9,7 +9,7 @@ class TorrentsDL {
9 9
   private $QueryRowNum = 0;
10 10
   private $Zip;
11 11
   private $IDBoundaries;
12
-  private $FailedFiles = array();
12
+  private $FailedFiles = [];
13 13
   private $NumAdded = 0;
14 14
   private $NumFound = 0;
15 15
   private $Size = 0;
@@ -35,7 +35,7 @@ class TorrentsDL {
35 35
     function add_passkey($Ann) {
36 36
       return (is_array($Ann)) ? array_map('add_passkey', $Ann) : $Ann."/".G::$LoggedUser['torrent_pass']."/announce";
37 37
     }
38
-    $this->AnnounceList = (sizeof(ANNOUNCE_URLS) == 1 && sizeof(ANNOUNCE_URLS[0]) == 1) ? array() : array_map('add_passkey', ANNOUNCE_URLS);
38
+    $this->AnnounceList = (sizeof(ANNOUNCE_URLS) == 1 && sizeof(ANNOUNCE_URLS[0]) == 1) ? [] : array_map('add_passkey', ANNOUNCE_URLS);
39 39
     $this->Zip = new Zip(Misc::file_string($Title));
40 40
   }
41 41
 
@@ -46,7 +46,7 @@ class TorrentsDL {
46 46
    * @return array with results and torrent group IDs or false if there are no results left
47 47
    */
48 48
   public function get_downloads($Key) {
49
-    $GroupIDs = $Downloads = array();
49
+    $GroupIDs = $Downloads = [];
50 50
     $OldQuery = G::$DB->get_query_id();
51 51
     G::$DB->set_query_id($this->QueryResult);
52 52
     if (!isset($this->IDBoundaries)) {
@@ -189,7 +189,7 @@ class TorrentsDL {
189 189
     if ($Year > 0) {
190 190
       $TorrentName .= " - $Year";
191 191
     }
192
-    $TorrentInfo = array();
192
+    $TorrentInfo = [];
193 193
     if ($Media != '') {
194 194
       $TorrentInfo[] = $Media;
195 195
     }
@@ -224,7 +224,7 @@ class TorrentsDL {
224 224
    * @param mixed $TorrentData bencoded torrent without announce URL (new format) or TORRENT object (old format)
225 225
    * @return bencoded string
226 226
    */
227
-  public static function get_file(&$TorrentData, $AnnounceURL, $AnnounceList = array()) {
227
+  public static function get_file(&$TorrentData, $AnnounceURL, $AnnounceList = []) {
228 228
     if (Misc::is_new_torrent($TorrentData)) {
229 229
       $Bencode = BencodeTorrent::add_announce_url($TorrentData, $AnnounceURL);
230 230
       if (!empty($AnnounceList)) {

+ 2
- 2
classes/tracker.class.php View File

@@ -4,7 +4,7 @@ class Tracker {
4 4
   const STATS_MAIN = 0;
5 5
   const STATS_USER = 1;
6 6
 
7
-  public static $Requests = array();
7
+  public static $Requests = [];
8 8
 
9 9
   /**
10 10
    * Send a GET request over a socket directly to the tracker
@@ -109,7 +109,7 @@ class Tracker {
109 109
     if ($Response === false) {
110 110
       return false;
111 111
     }
112
-    $Stats = array();
112
+    $Stats = [];
113 113
     foreach (explode("\n", $Response) as $Stat) {
114 114
       list($Val, $Key) = explode(" ", $Stat, 2);
115 115
       $Stats[$Key] = $Val;

+ 1
- 1
classes/twofa.class.php View File

@@ -7,7 +7,7 @@ class TwoFactorAuth {
7 7
   private $issuer;
8 8
   private static $_base32dict = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=';
9 9
   private static $_base32;
10
-  private static $_base32lookup = array();
10
+  private static $_base32lookup = [];
11 11
   private static $_supportedalgos = array('sha1', 'sha256', 'sha512', 'md5');
12 12
 
13 13
   function __construct($issuer = null, $digits = 6, $period = 30, $algorithm = 'sha1') {

+ 1
- 1
classes/util.php View File

@@ -191,7 +191,7 @@ function json_print($Status, $Message) {
191 191
   } elseif ($Message) {
192 192
     print json_encode(array('status' => $Status, 'error' => $Message));
193 193
   } else {
194
-    print json_encode(array('status' => $Status, 'response' => array()));
194
+    print json_encode(array('status' => $Status, 'response' => []));
195 195
   }
196 196
 }
197 197
 

+ 2
- 2
classes/validate.class.php View File

@@ -6,9 +6,9 @@ Finish the GenerateJS stuff
6 6
 //-----------------------------------*/
7 7
 
8 8
 class VALIDATE {
9
-  var $Fields = array();
9
+  var $Fields = [];
10 10
 
11
-  function SetFields($FieldName, $Required, $FieldType, $ErrorMessage, $Options = array()) {
11
+  function SetFields($FieldName, $Required, $FieldType, $ErrorMessage, $Options = []) {
12 12
     $this->Fields[$FieldName]['Type'] = strtolower($FieldType);
13 13
     $this->Fields[$FieldName]['Required'] = $Required;
14 14
     $this->Fields[$FieldName]['ErrorMessage'] = $ErrorMessage;

+ 2
- 2
classes/view.class.php View File

@@ -53,7 +53,7 @@ class View {
53 53
    *                 Here is a list of parameters that work in the $Options array:
54 54
    *                 ['disclaimer'] = [boolean] (False) Displays the disclaimer in the footer
55 55
    */
56
-  public static function show_footer($Options = array()) {
56
+  public static function show_footer($Options = []) {
57 57
     global $ScriptStartTime, $SessionID, $UserSessions, $Debug, $Time, $Mobile;
58 58
     if (!is_array(G::$LoggedUser) || (isset($Options['recover']) && $Options['recover'] === true)) {
59 59
       require(SERVER_ROOT.'/design/publicfooter.php');
@@ -125,7 +125,7 @@ class View {
125 125
    *  echo $SavedTemplate; // Output the buffer
126 126
    * </pre>
127 127
    */
128
-  public static function parse($TemplateFile, array $Variables = array(), $Buffer = false) {
128
+  public static function parse($TemplateFile, array $Variables = [], $Buffer = false) {
129 129
     $Template = self::IncludePath . $TemplateFile;
130 130
     if (file_exists($Template)) {
131 131
       extract($Variables);

+ 2
- 2
classes/votes.class.php View File

@@ -31,7 +31,7 @@ class Votes {
31 31
    */
32 32
   public static function get_user_votes($UserID) {
33 33
     if ((int)$UserID == 0) {
34
-      return array();
34
+      return [];
35 35
     }
36 36
 
37 37
     $UserVotes = G::$Cache->get_value("voted_albums_$UserID");
@@ -295,7 +295,7 @@ class Votes {
295 295
    * @return array (<GroupID> => <Rank>)
296 296
    */
297 297
   public static function calc_ranks($GroupScores) {
298
-    $Rankings = array();
298
+    $Rankings = [];
299 299
     $PrevScore = $PrevRank = false;
300 300
     $Rank = 1;
301 301
     foreach ($GroupScores as $GroupID => $Score) {

+ 3
- 3
design/privateheader.php View File

@@ -117,7 +117,7 @@ $NotificationsManager = new NotificationsManager(G::$LoggedUser['ID']);
117 117
 $Notifications = $NotificationsManager->get_notifications();
118 118
 $UseNoty = $NotificationsManager->use_noty();
119 119
 $NewSubscriptions = false;
120
-$NotificationSpans = array();
120
+$NotificationSpans = [];
121 121
 foreach ($Notifications as $Type => $Notification) {
122 122
   if ($Type === NotificationsManager::SUBSCRIPTIONS) {
123 123
     $NewSubscriptions = true;
@@ -339,8 +339,8 @@ if (check_perms('site_send_unlimited_invites')) {
339 339
     </div>
340 340
 <?
341 341
 //Start handling alert bars
342
-$Alerts = array();
343
-$ModBar = array();
342
+$Alerts = [];
343
+$ModBar = [];
344 344
 
345 345
 // Staff blog
346 346
 if (check_perms('users_mod')) {

+ 1
- 1
feeds.php View File

@@ -91,7 +91,7 @@ function is_utf8($Str) {
91 91
   );
92 92
 }
93 93
 
94
-function display_array($Array, $Escape = array()) {
94
+function display_array($Array, $Escape = []) {
95 95
   foreach ($Array as $Key => $Val) {
96 96
     if ((!is_array($Escape) && $Escape == true) || !in_array($Key, $Escape)) {
97 97
       $Array[$Key] = display_str($Val);

+ 2
- 2
sections/ajax/announcements.php View File

@@ -42,7 +42,7 @@ if (($Blog = $Cache->get_value('blog')) === false) {
42 42
   $Blog = $DB->to_array();
43 43
   $Cache->cache_value('blog', $Blog, 1209600);
44 44
 }
45
-$JsonBlog = array();
45
+$JsonBlog = [];
46 46
 for ($i = 0; $i < 5; $i++) {
47 47
   list($BlogID, $Author, $AuthorID, $Title, $Body, $BlogTime, $ThreadID) = $Blog[$i];
48 48
   $JsonBlog[] = array(
@@ -56,7 +56,7 @@ for ($i = 0; $i < 5; $i++) {
56 56
   );
57 57
 }
58 58
 
59
-$JsonAnnouncements = array();
59
+$JsonAnnouncements = [];
60 60
 $Count = 0;
61 61
 foreach ($News as $NewsItem) {
62 62
   list($NewsID, $Title, $Body, $NewsTime) = $NewsItem;

+ 11
- 11
sections/ajax/artist.php View File

@@ -98,7 +98,7 @@ if ($Data) {
98 98
 }
99 99
 
100 100
 // Requests
101
-$Requests = array();
101
+$Requests = [];
102 102
 if (empty($LoggedUser['DisableRequests'])) {
103 103
   $Requests = $Cache->get_value("artists_requests_$ArtistID");
104 104
   if (!is_array($Requests)) {
@@ -122,7 +122,7 @@ if (empty($LoggedUser['DisableRequests'])) {
122 122
     if ($DB->has_results()) {
123 123
       $Requests = $DB->to_array('ID', MYSQLI_ASSOC, false);
124 124
     } else {
125
-      $Requests = array();
125
+      $Requests = [];
126 126
     }
127 127
     $Cache->cache_value("artists_requests_$ArtistID", $Requests);
128 128
   }
@@ -150,7 +150,7 @@ if (($Importances = $Cache->get_value("artist_groups_$ArtistID")) === false) {
150 150
   $Importances = $DB->to_array(false, MYSQLI_BOTH, false);
151 151
   $Cache->cache_value("artist_groups_$ArtistID", $Importances, 0);
152 152
 } else {
153
-  $GroupIDs = array();
153
+  $GroupIDs = [];
154 154
   foreach ($Importances as $Group) {
155 155
     $GroupIDs[] = $Group['GroupID'];
156 156
   }
@@ -158,12 +158,12 @@ if (($Importances = $Cache->get_value("artist_groups_$ArtistID")) === false) {
158 158
 if (count($GroupIDs) > 0) {
159 159
   $TorrentList = Torrents::get_groups($GroupIDs, true, true);
160 160
 } else {
161
-  $TorrentList = array();
161
+  $TorrentList = [];
162 162
 }
163 163
 $NumGroups = count($TorrentList);
164 164
 
165 165
 //Get list of used release types
166
-$UsedReleases = array();
166
+$UsedReleases = [];
167 167
 foreach ($TorrentList as $GroupID=>$Group) {
168 168
   if ($Importances[$GroupID]['Importance'] == '2') {
169 169
     $TorrentList[$GroupID]['ReleaseType'] = 1024;
@@ -201,8 +201,8 @@ if (!empty($ProducerAlbums)) {
201 201
 
202 202
 reset($TorrentList);
203 203
 
204
-$JsonTorrents = array();
205
-$Tags = array();
204
+$JsonTorrents = [];
205
+$Tags = [];
206 206
 $NumTorrents = $NumSeeders = $NumLeechers = $NumSnatches = 0;
207 207
 foreach ($GroupIDs as $GroupID) {
208 208
   if (!isset($TorrentList[$GroupID])) {
@@ -240,7 +240,7 @@ foreach ($GroupIDs as $GroupID) {
240 240
       $Tags[$Tag]['count']++;
241 241
     }
242 242
   }
243
-  $InnerTorrents = array();
243
+  $InnerTorrents = [];
244 244
   foreach ($Torrents as $Torrent) {
245 245
     $NumTorrents++;
246 246
     $NumSeeders += $Torrent['Seeders'];
@@ -290,7 +290,7 @@ foreach ($GroupIDs as $GroupID) {
290 290
   );
291 291
 }
292 292
 
293
-$JsonSimilar = array();
293
+$JsonSimilar = [];
294 294
 if (empty($SimilarArray)) {
295 295
   $DB->query("
296 296
     SELECT
@@ -328,7 +328,7 @@ if (empty($SimilarArray)) {
328 328
   }
329 329
 }
330 330
 
331
-$JsonRequests = array();
331
+$JsonRequests = [];
332 332
 foreach ($Requests as $RequestID => $Request) {
333 333
   $JsonRequests[] = array(
334 334
     'requestId' => (int)$RequestID,
@@ -369,7 +369,7 @@ if ($RevisionID) {
369 369
   $Key = "artist_$ArtistID";
370 370
 }
371 371
 
372
-$Data = array(array($Name, $Image, $Body, $NumSimilar, $SimilarArray, array(), array(), $VanityHouseArtist));
372
+$Data = array(array($Name, $Image, $Body, $NumSimilar, $SimilarArray, [], [], $VanityHouseArtist));
373 373
 
374 374
 $Cache->cache_value($Key, $Data, 3600);
375 375
 

+ 2
- 2
sections/ajax/better/single.php View File

@@ -18,7 +18,7 @@ if (($Results = $Cache->get_value('better_single_groupids')) === false) {
18 18
 
19 19
 $Groups = Torrents::get_groups(array_keys($Results));
20 20
 
21
-$JsonResults = array();
21
+$JsonResults = [];
22 22
 foreach ($Results as $GroupID => $FlacID) {
23 23
   if (!isset($Groups[$GroupID])) {
24 24
     continue;
@@ -26,7 +26,7 @@ foreach ($Results as $GroupID => $FlacID) {
26 26
   $Group = $Groups[$GroupID];
27 27
   extract(Torrents::array_group($Group));
28 28
 
29
-  $JsonArtists = array();
29
+  $JsonArtists = [];
30 30
   if (count($Artists) > 0) {
31 31
     foreach ($Artists as $Artist) {
32 32
       $JsonArtists[] = array(

+ 6
- 6
sections/ajax/better/transcode.php View File

@@ -37,7 +37,7 @@ if ($TorrentCount == 0) {
37 37
 $Results = $SphQLResult->to_array('groupid');
38 38
 $Groups = Torrents::get_groups(array_keys($Results));
39 39
 
40
-$TorrentGroups = array();
40
+$TorrentGroups = [];
41 41
 foreach ($Groups as $GroupID => $Group) {
42 42
   if (empty($Group['Torrents'])) {
43 43
     unset($Groups[$GroupID]);
@@ -49,7 +49,7 @@ foreach ($Groups as $GroupID => $Group) {
49 49
       $TorrentGroups[$Group['ID']] = array(
50 50
         $TorRemIdent => array(
51 51
           'FlacID' => 0,
52
-          'Formats' => array(),
52
+          'Formats' => [],
53 53
           'RemasterTitle' => $Torrent['RemasterTitle'],
54 54
           'RemasterYear' => $Torrent['RemasterYear'],
55 55
           'RemasterRecordLabel' => $Torrent['RemasterRecordLabel'],
@@ -60,7 +60,7 @@ foreach ($Groups as $GroupID => $Group) {
60 60
     } elseif (!isset($TorrentGroups[$Group['ID']][$TorRemIdent])) {
61 61
       $TorrentGroups[$Group['ID']][$TorRemIdent] = array(
62 62
         'FlacID' => 0,
63
-        'Formats' => array(),
63
+        'Formats' => [],
64 64
         'RemasterTitle' => $Torrent['RemasterTitle'],
65 65
         'RemasterYear' => $Torrent['RemasterYear'],
66 66
         'RemasterRecordLabel' => $Torrent['RemasterRecordLabel'],
@@ -77,7 +77,7 @@ foreach ($Groups as $GroupID => $Group) {
77 77
   }
78 78
 }
79 79
 
80
-$JsonResults = array();
80
+$JsonResults = [];
81 81
 foreach ($TorrentGroups as $GroupID => $Editions) {
82 82
   $GroupInfo = $Groups[$GroupID];
83 83
   $GroupYear = $GroupInfo['Year'];
@@ -95,9 +95,9 @@ foreach ($TorrentGroups as $GroupID => $Editions) {
95 95
     $ArtistNames = '';
96 96
   }
97 97
 
98
-  $TagList = array();
98
+  $TagList = [];
99 99
   $TagList = explode(' ', str_replace('_', '.', $GroupInfo['TagList']));
100
-  $TorrentTags = array();
100
+  $TorrentTags = [];
101 101
   foreach ($TagList as $Tag) {
102 102
     $TorrentTags[] = "<a href=\"torrents.php?taglist=$Tag\">$Tag</a>";
103 103
   }

+ 1
- 1
sections/ajax/bookmarks/artists.php View File

@@ -42,7 +42,7 @@ $DB->query("
42 42
 
43 43
 $ArtistList = $DB->to_array();
44 44
 
45
-$JsonArtists = array();
45
+$JsonArtists = [];
46 46
 foreach ($ArtistList as $Artist) {
47 47
   list($ArtistID, $Name) = $Artist;
48 48
   $JsonArtists[] = array(

+ 2
- 2
sections/ajax/bookmarks/torrents.php View File

@@ -27,7 +27,7 @@ if (!empty($_GET['userid'])) {
27 27
 
28 28
 $Sneaky = ($UserID != $LoggedUser['ID']);
29 29
 
30
-$JsonBookmarks = array();
30
+$JsonBookmarks = [];
31 31
 
32 32
 list($GroupIDs, $CollageDataList, $GroupList) = Users::get_bookmarks($UserID);
33 33
 foreach($GroupIDs as $GroupID) {
@@ -35,7 +35,7 @@ foreach($GroupIDs as $GroupID) {
35 35
     continue;
36 36
   }
37 37
   $Group = $GroupList[$GroupID];
38
-  $JsonTorrents = array();
38
+  $JsonTorrents = [];
39 39
   foreach ($Group['Torrents'] as $Torrent) {
40 40
     $JsonTorrents[] = array(
41 41
       'id' => (int)$Torrent['ID'],

+ 4
- 4
sections/ajax/browse.php View File

@@ -26,13 +26,13 @@ if ($Results === false) {
26 26
 
27 27
 if ($NumResults == 0) {
28 28
   json_die("success", array(
29
-    'results' => array()
29
+    'results' => []
30 30
   ));
31 31
 }
32 32
 
33 33
 $Bookmarks = Bookmarks::all_bookmarks('torrent');
34 34
 
35
-$JsonGroups = array();
35
+$JsonGroups = [];
36 36
 foreach ($Results as $Key => $GroupID) {
37 37
   $GroupInfo = $Groups[$GroupID];
38 38
   if (empty($GroupInfo['Torrents'])) {
@@ -59,7 +59,7 @@ foreach ($Results as $Key => $GroupID) {
59 59
   }
60 60
 
61 61
   $TagList = explode(' ', str_replace('_', '.', $GroupInfo['TagList']));
62
-  $JsonArtists = array();
62
+  $JsonArtists = [];
63 63
   if (!empty($ExtendedArtists[1]) || !empty($ExtendedArtists[4]) || !empty($ExtendedArtists[5]) || !empty($ExtendedArtists[6])) {
64 64
     unset($ExtendedArtists[2]);
65 65
     unset($ExtendedArtists[3]);
@@ -75,7 +75,7 @@ foreach ($Results as $Key => $GroupID) {
75 75
     $DisplayName = '';
76 76
   }
77 77
 
78
-  $JsonTorrents = array();
78
+  $JsonTorrents = [];
79 79
   foreach ($Torrents as $TorrentID => $Data) {
80 80
     // All of the individual torrents in the group
81 81
 

+ 10
- 10
sections/ajax/collage.php View File

@@ -57,7 +57,7 @@ $JSON = array(
57 57
 
58 58
 if ($CollageCategoryID != array_search(ARTIST_COLLAGE, $CollageCats)) {
59 59
   // torrent collage
60
-  $TorrentGroups = array();
60
+  $TorrentGroups = [];
61 61
   $DB->query("
62 62
     SELECT
63 63
       ct.GroupID
@@ -73,18 +73,18 @@ if ($CollageCategoryID != array_search(ARTIST_COLLAGE, $CollageCats)) {
73 73
       if ($GroupDetails['GroupCategoryID'] > 0 && $Categories[$GroupDetails['GroupCategoryID'] - 1] == 'Music') {
74 74
         $ArtistForm = $GroupDetails['ExtendedArtists'];
75 75
         $JsonMusicInfo = array(
76
-          'composers' => isset($ArtistForm[4]) ? pullmediainfo($ArtistForm[4]) : array(),
77
-          'dj'        => isset($ArtistForm[6]) ? pullmediainfo($ArtistForm[6]) : array(),
78
-          'artists'   => isset($ArtistForm[1]) ? pullmediainfo($ArtistForm[1]) : array(),
79
-          'with'      => isset($ArtistForm[2]) ? pullmediainfo($ArtistForm[2]) : array(),
80
-          'conductor' => isset($ArtistForm[5]) ? pullmediainfo($ArtistForm[5]) : array(),
81
-          'remixedBy' => isset($ArtistForm[3]) ? pullmediainfo($ArtistForm[3]) : array(),
82
-          'producer'  => isset($ArtistForm[7]) ? pullmediainfo($ArtistForm[7]) : array()
76
+          'composers' => isset($ArtistForm[4]) ? pullmediainfo($ArtistForm[4]) : [],
77
+          'dj'        => isset($ArtistForm[6]) ? pullmediainfo($ArtistForm[6]) : [],
78
+          'artists'   => isset($ArtistForm[1]) ? pullmediainfo($ArtistForm[1]) : [],
79
+          'with'      => isset($ArtistForm[2]) ? pullmediainfo($ArtistForm[2]) : [],
80
+          'conductor' => isset($ArtistForm[5]) ? pullmediainfo($ArtistForm[5]) : [],
81
+          'remixedBy' => isset($ArtistForm[3]) ? pullmediainfo($ArtistForm[3]) : [],
82
+          'producer'  => isset($ArtistForm[7]) ? pullmediainfo($ArtistForm[7]) : []
83 83
         );
84 84
       } else {
85 85
         $JsonMusicInfo = null;
86 86
       }
87
-      $TorrentList = array();
87
+      $TorrentList = [];
88 88
       foreach ($GroupDetails['Torrents'] as $Torrent) {
89 89
         $TorrentList[] = array(
90 90
           'torrentid'               => (int)$Torrent['ID'],
@@ -139,7 +139,7 @@ if ($CollageCategoryID != array_search(ARTIST_COLLAGE, $CollageCats)) {
139 139
       LEFT JOIN wiki_artists AS aw ON aw.RevisionID = ag.RevisionID
140 140
     WHERE ca.CollageID='$CollageID'
141 141
     ORDER BY ca.Sort");
142
-  $Artists = array();
142
+  $Artists = [];
143 143
   while (list($ArtistID, $ArtistName, $ArtistImage) = $DB->next_record()) {
144 144
     $Artists[] = array(
145 145
       'id'    => (int)$ArtistID,

+ 3
- 3
sections/ajax/doujin.php View File

@@ -6,7 +6,7 @@ if (empty($_GET['url'])) {
6 6
 
7 7
 $url = str_replace('exhentai','e-hentai',$_GET['url']);
8 8
 
9
-$matches = array();
9
+$matches = [];
10 10
 preg_match('/^https?:\/\/g?\.?e.hentai\.org\/g\/(\d+)\/([\w\d]+)\/?$/', $url, $matches);
11 11
 
12 12
 $gid = $matches[1] ?? '';
@@ -35,8 +35,8 @@ if ($Cache->get_value('doujin_json_'.$gid)) {
35 35
 
36 36
   $json = json_decode($json, true)["gmetadata"][0];
37 37
 
38
-  $artists = array();
39
-  $tags = array();
38
+  $artists = [];
39
+  $tags = [];
40 40
   $lang = NULL;
41 41
   $circle = NULL;
42 42
   $censored = true;

+ 3
- 3
sections/ajax/forum/forum.php View File

@@ -78,7 +78,7 @@ if ($LoggedUser['CustomForums'][$ForumID] != 1 && $Forums[$ForumID]['MinClassRea
78 78
 }
79 79
 
80 80
 $ForumName = display_str($Forums[$ForumID]['Name']);
81
-$JsonSpecificRules = array();
81
+$JsonSpecificRules = [];
82 82
 foreach ($Forums[$ForumID]['SpecificRules'] as $ThreadIDs) {
83 83
   $Thread = Forums::get_thread_info($ThreadIDs);
84 84
   $JsonSpecificRules[] = array(
@@ -95,7 +95,7 @@ if (count($Forum) === 0) {
95 95
       array(
96 96
         'status' => 'success',
97 97
         'forumName' => $ForumName,
98
-        'threads' => array()
98
+        'threads' => []
99 99
       )
100 100
     );
101 101
 } else {
@@ -122,7 +122,7 @@ if (count($Forum) === 0) {
122 122
   // don't have to make a database query for each topic on the page
123 123
   $LastRead = $DB->to_array('TopicID');
124 124
 
125
-  $JsonTopics = array();
125
+  $JsonTopics = [];
126 126
   foreach ($Forum as $Topic) {
127 127
     list($TopicID, $Title, $AuthorID, $Locked, $Sticky, $PostCount, $LastID, $LastTime, $LastAuthorID) = array_values($Topic);
128 128
 

+ 6
- 6
sections/ajax/forum/main.php View File

@@ -7,7 +7,7 @@ if (isset($LoggedUser['PostsPerPage'])) {
7 7
 }
8 8
 
9 9
 //We have to iterate here because if one is empty it breaks the query
10
-$TopicIDs = array();
10
+$TopicIDs = [];
11 11
 foreach ($Forums as $Forum) {
12 12
   if (!empty($Forum['LastPostTopicID'])) {
13 13
     $TopicIDs[] = $Forum['LastPostTopicID'];
@@ -33,7 +33,7 @@ if (!empty($TopicIDs)) {
33 33
       AND l.UserID = '$LoggedUser[ID]'");
34 34
   $LastRead = $DB->to_array('TopicID', MYSQLI_ASSOC);
35 35
 } else {
36
-  $LastRead = array();
36
+  $LastRead = [];
37 37
 }
38 38
 
39 39
 $DB->query("
@@ -44,9 +44,9 @@ list($RestrictedForums) = $DB->next_record();
44 44
 $RestrictedForums = explode(',', $RestrictedForums);
45 45
 $PermittedForums = array_keys($LoggedUser['PermittedForums']);
46 46
 
47
-$JsonCategories = array();
48
-$JsonCategory = array();
49
-$JsonForums = array();
47
+$JsonCategories = [];
48
+$JsonCategory = [];
49
+$JsonForums = [];
50 50
 foreach ($Forums as $Forum) {
51 51
   list($ForumID, $CategoryID, $ForumName, $ForumDescription, $MinRead, $MinWrite, $MinCreate, $NumTopics, $NumPosts, $LastPostID, $LastAuthorID, $LastTopicID, $LastTime, $SpecificRules, $LastTopic, $Locked, $Sticky) = array_values($Forum);
52 52
   if ($LoggedUser['CustomForums'][$ForumID] != 1
@@ -67,7 +67,7 @@ foreach ($Forums as $Forum) {
67 67
       'categoryID' => (int)$CategoryID,
68 68
       'categoryName' => $ForumCats[$CategoryID]
69 69
     );
70
-    $JsonForums = array();
70
+    $JsonForums = [];
71 71
   }
72 72
 
73 73
   if ((!$Locked || $Sticky)

+ 5
- 5
sections/ajax/forum/thread.php View File

@@ -137,14 +137,14 @@ if ($_GET['updatelastread'] !== '0') {
137 137
 $UserSubscriptions = Subscriptions::get_subscriptions();
138 138
 
139 139
 if (empty($UserSubscriptions)) {
140
-  $UserSubscriptions = array();
140
+  $UserSubscriptions = [];
141 141
 }
142 142
 
143 143
 if (in_array($ThreadID, $UserSubscriptions)) {
144 144
   $Cache->delete_value('subscriptions_user_new_'.$LoggedUser['ID']);
145 145
 }
146 146
 
147
-$JsonPoll = array();
147
+$JsonPoll = [];
148 148
 if ($ThreadInfo['NoPoll'] == 0) {
149 149
   if (!list($Question, $Answers, $Votes, $Featured, $Closed) = $Cache->get_value("polls_$ThreadID")) {
150 150
     $DB->query("
@@ -160,7 +160,7 @@ if ($ThreadInfo['NoPoll'] == 0) {
160 160
       GROUP BY Vote");
161 161
     $VoteArray = $DB->to_array(false, MYSQLI_NUM);
162 162
 
163
-    $Votes = array();
163
+    $Votes = [];
164 164
     foreach ($VoteArray as $VoteSet) {
165 165
       list($Key, $Value) = $VoteSet;
166 166
       $Votes[$Key] = $Value;
@@ -203,7 +203,7 @@ if ($ThreadInfo['NoPoll'] == 0) {
203 203
   $JsonPoll['question'] = $Question;
204 204
   $JsonPoll['maxVotes'] = (int)$MaxVotes;
205 205
   $JsonPoll['totalVotes'] = $TotalVotes;
206
-  $JsonPollAnswers = array();
206
+  $JsonPollAnswers = [];
207 207
 
208 208
   foreach ($Answers as $i => $Answer) {
209 209
     if (!empty($Votes[$i]) && $TotalVotes > 0) {
@@ -239,7 +239,7 @@ if ($ThreadInfo['StickyPostID']) {
239 239
   }
240 240
 }
241 241
 
242
-$JsonPosts = array();
242
+$JsonPosts = [];
243 243
 foreach ($Thread as $Key => $Post) {
244 244
   list($PostID, $AuthorID, $AddedTime, $Body, $EditedUserID, $EditedTime) = array_values($Post);
245 245
   list($AuthorID, $Username, $PermissionID, $Paranoia, $Artist, $Donor, $Warned, $Avatar, $Enabled, $UserTitle) = array_values(Users::user_info($AuthorID));

+ 1
- 1
sections/ajax/get_user_notifications.php View File

@@ -1,6 +1,6 @@
1 1
 <?
2 2
 
3
-$Skip = array();
3
+$Skip = [];
4 4
 $Skip[] = db_string($_GET['skip']);
5 5
 $NotificationsManager = new NotificationsManager($LoggedUser['ID'], $Skip);
6 6
 

+ 1
- 1
sections/ajax/inbox/inbox.php View File

@@ -83,7 +83,7 @@ if (empty($CurURL)) {
83 83
 
84 84
 $Pages = Format::get_pages($Page, $NumResults, MESSAGES_PER_PAGE, 9);
85 85
 
86
-$JsonMessages = array();
86
+$JsonMessages = [];
87 87
 while (list($ConvID, $Subject, $Unread, $Sticky, $ForwardedID, $ForwardedName, $SenderID, $Username, $Donor, $Warned, $Enabled, $Avatar, $Date) = $DB->next_record()) {
88 88
   $JsonMessage = array(
89 89
     'convId' => (int)$ConvID,

+ 1
- 1
sections/ajax/inbox/viewconv.php View File

@@ -76,7 +76,7 @@ $DB->query("
76 76
   WHERE ConvID = '$ConvID'
77 77
   ORDER BY ID");
78 78
 
79
-$JsonMessages = array();
79
+$JsonMessages = [];
80 80
 while (list($SentDate, $SenderID, $Body, $MessageID) = $DB->next_record()) {
81 81
   $Body = apcu_exists('DBKEY') ? DBCrypt::decrypt($Body) : '[Encrypted]';
82 82
   $JsonMessage = array(

+ 1
- 1
sections/ajax/index.php View File

@@ -175,7 +175,7 @@ switch ($_GET['action']) {
175 175
 }
176 176
 
177 177
 function pullmediainfo($Array) {
178
-  $NewArray = array();
178
+  $NewArray = [];
179 179
   foreach ($Array as $Item) {
180 180
     $NewArray[] = array(
181 181
       'id' => (int)$Item['id'],

+ 4
- 3
sections/ajax/javfill.php View File

@@ -70,7 +70,7 @@ if (!$debug && $Cache->get_value('jav_json_'.$cn)) {
70 70
   if ($jlib_page_en && $jlib_en->query('//*[@id="video_title"]')['length']) {
71 71
     $title = $jlib_en->query('//*[@id="video_title"]/h3/a')->item(0)->nodeValue;
72 72
     $title = substr($title, strlen($cn) + 1);
73
-    $idols = array();
73
+    $idols = [];
74 74
     foreach ($jlib_en->query('//*[starts-with(@id, "cast")]/span[1]/a') as $idol) {
75 75
       $idols[] = $idol->nodeValue;
76 76
     }
@@ -94,11 +94,12 @@ if (!$debug && $Cache->get_value('jav_json_'.$cn)) {
94 94
       $twist = new DOMDocument();
95 95
       $twist->loadHTML($twist_t);
96 96
       $twist = new DOMXPath($twist);
97
-      if ($twist->query('//img[@class="pic"]')->item(0))
97
+      if ($twist->query('//img[@class="pic"]')->item(0)) {
98 98
         $screens[] =  $twist->query('//img[@class="pic"]')->item(0)->getAttribute('src');
99
+      }
99 100
     }
100 101
     $desc = '';
101
-    $genres = array();
102
+    $genres = [];
102 103
     foreach ($jlib_en->query('//*[starts-with(@id, "genre")]/a') as $genre) {
103 104
       $genres[] =  str_replace(' ', '.', strtolower($genre->nodeValue));
104 105
     }

+ 1
- 1
sections/ajax/news_ajax.php View File

@@ -23,7 +23,7 @@ $DB->query("
23 23
     LIMIT $Offset, $Count");
24 24
 $News = $DB->to_array(false, MYSQLI_NUM, false);
25 25
 
26
-$NewsResponse = array();
26
+$NewsResponse = [];
27 27
 foreach ($News as $NewsItem) {
28 28
   list($NewsID, $Title, $Body, $NewsTime) = $NewsItem;
29 29
   array_push(

+ 3
- 3
sections/ajax/notifications.php View File

@@ -39,16 +39,16 @@ if (count($GroupIDs)) {
39 39
 
40 40
 $DB->set_query_id($Results);
41 41
 
42
-$JsonNotifications = array();
42
+$JsonNotifications = [];
43 43
 $NumNew = 0;
44 44
 
45
-$FilterGroups = array();
45
+$FilterGroups = [];
46 46
 while ($Result = $DB->next_record(MYSQLI_ASSOC)) {
47 47
   if (!$Result['FilterID']) {
48 48
     $Result['FilterID'] = 0;
49 49
   }
50 50
   if (!isset($FilterGroups[$Result['FilterID']])) {
51
-    $FilterGroups[$Result['FilterID']] = array();
51
+    $FilterGroups[$Result['FilterID']] = [];
52 52
     $FilterGroups[$Result['FilterID']]['FilterLabel'] = ($Result['Label'] ? $Result['Label'] : false);
53 53
   }
54 54
   array_push($FilterGroups[$Result['FilterID']], $Result);

+ 3
- 3
sections/ajax/request.php View File

@@ -44,7 +44,7 @@ $ProjectCanEdit = (check_perms('project_team') && !$IsFilled && (($CategoryID ==
44 44
 $UserCanEdit = (!$IsFilled && $LoggedUser['ID'] == $Request['UserID'] && $VoteCount < 2);
45 45
 $CanEdit = ($UserCanEdit || $ProjectCanEdit || check_perms('site_moderate_requests'));
46 46
 
47
-$JsonTopContributors = array();
47
+$JsonTopContributors = [];
48 48
 $VoteMax = ($VoteCount < 5 ? $VoteCount : 5);
49 49
 for ($i = 0; $i < $VoteMax; $i++) {
50 50
   $User = array_shift($RequestVotes['Voters']);
@@ -58,7 +58,7 @@ reset($RequestVotes['Voters']);
58 58
 
59 59
 list($NumComments, $Page, $Thread) = Comments::load('requests', $RequestID, false);
60 60
 
61
-$JsonRequestComments = array();
61
+$JsonRequestComments = [];
62 62
 foreach ($Thread as $Key => $Post) {
63 63
   list($PostID, $AuthorID, $AddedTime, $Body, $EditedUserID, $EditedTime, $EditedUsername) = array_values($Post);
64 64
   list($AuthorID, $Username, $PermissionID, $Paranoia, $Artist, $Donor, $Warned, $Avatar, $Enabled, $UserTitle) = array_values(Users::user_info($AuthorID));
@@ -79,7 +79,7 @@ foreach ($Thread as $Key => $Post) {
79 79
   );
80 80
 }
81 81
 
82
-$JsonTags = array();
82
+$JsonTags = [];
83 83
 foreach ($Request['Tags'] as $Tag) {
84 84
   $JsonTags[] = $Tag;
85 85
 }

+ 8
- 8
sections/ajax/requests.php View File

@@ -107,7 +107,7 @@ if ($Submitted && empty($_GET['show_filled'])) {
107 107
 if (!empty($_GET['formats'])) {
108 108
   $FormatArray = $_GET['formats'];
109 109
   if (count($FormatArray) !== count($Formats)) {
110
-    $FormatNameArray = array();
110
+    $FormatNameArray = [];
111 111
     foreach ($FormatArray as $Index => $MasterIndex) {
112 112
       if (isset($Formats[$MasterIndex])) {
113 113
         $FormatNameArray[$Index] = '"' . strtr(Sphinxql::sph_escape_string($Formats[$MasterIndex]), '-.', '  ') . '"';
@@ -127,7 +127,7 @@ if (!empty($_GET['formats'])) {
127 127
 if (!empty($_GET['media'])) {
128 128
   $MediaArray = $_GET['media'];
129 129
   if (count($MediaArray) !== count($Media)) {
130
-    $MediaNameArray = array();
130
+    $MediaNameArray = [];
131 131
     foreach ($MediaArray as $Index => $MasterIndex) {
132 132
       if (isset($Media[$MasterIndex])) {
133 133
         $MediaNameArray[$Index] = '"' . strtr(Sphinxql::sph_escape_string($Media[$MasterIndex]), '-.', '  ') . '"';
@@ -148,7 +148,7 @@ if (!empty($_GET['media'])) {
148 148
 if (!empty($_GET['bitrates'])) {
149 149
   $BitrateArray = $_GET['bitrates'];
150 150
   if (count($BitrateArray) !== count($Bitrates)) {
151
-    $BitrateNameArray = array();
151
+    $BitrateNameArray = [];
152 152
     foreach ($BitrateArray as $Index => $MasterIndex) {
153 153
       if (isset($Bitrates[$MasterIndex])) {
154 154
         $BitrateNameArray[$Index] = '"' . strtr(Sphinxql::sph_escape_string($Bitrates[$MasterIndex]), '-.', '  ') . '"';
@@ -169,7 +169,7 @@ if (!empty($_GET['bitrates'])) {
169 169
 if (!empty($_GET['search'])) {
170 170
   $SearchString = trim($_GET['search']);
171 171
   if ($SearchString !== '') {
172
-    $SearchWords = array('include' => array(), 'exclude' => array());
172
+    $SearchWords = array('include' => [], 'exclude' => []);
173 173
     $Words = explode(' ', $SearchString);
174 174
     foreach ($Words as $Word) {
175 175
       $Word = trim($Word);
@@ -198,7 +198,7 @@ if (!isset($_GET['tags_type']) || $_GET['tags_type'] === '1') {
198 198
   $_GET['tags_type'] = '0';
199 199
 }
200 200
 if (!empty($_GET['tags'])) {
201
-  $SearchTags = array('include' => array(), 'exclude' => array());
201
+  $SearchTags = array('include' => [], 'exclude' => []);
202 202
   $Tags = explode(',', $_GET['tags']);
203 203
   foreach ($Tags as $Tag) {
204 204
     $Tag = trim($Tag);
@@ -225,7 +225,7 @@ if (!empty($_GET['tags'])) {
225 225
 }
226 226
 
227 227
 if (isset($SearchWords)) {
228
-  $QueryParts = array();
228
+  $QueryParts = [];
229 229
   foreach ($SearchWords['include'] as $Word) {
230 230
     $QueryParts[] = Sphinxql::sph_escape_string($Word);
231 231
   }
@@ -311,10 +311,10 @@ if ($NumResults == 0) {
311 311
   json_die("success", array(
312 312
     'currentPage' => 1,
313 313
     'pages'       => 1,
314
-    'results'     => array()
314
+    'results'     => []
315 315
   ));
316 316
 } else {
317
-  $JsonResults = array();
317
+  $JsonResults = [];
318 318
   $Requests = Requests::get_requests(array_keys($SphRequests));
319 319
   foreach ($SphRequests as $RequestID => $SphRequest) {
320 320
     $Request = $Requests[$RequestID];

+ 1
- 1
sections/ajax/subscriptions.php View File

@@ -71,7 +71,7 @@ if ($NumResults > $PerPage * ($Page - 1)) {
71 71
   $DB->query($sql);
72 72
 }
73 73
 
74
-$JsonPosts = array();
74
+$JsonPosts = [];
75 75
 while (list($ForumID, $ForumName, $TopicID, $ThreadTitle, $Body, $LastPostID, $Locked, $Sticky, $PostID, $AuthorID, $AuthorName, $AuthorAvatar, $EditedUserID, $EditedTime, $EditedUsername) = $DB->next_record()) {
76 76
   $JsonPost = array(
77 77
     'forumId' => (int)$ForumID,

+ 1
- 1
sections/ajax/tcomments.php View File

@@ -6,7 +6,7 @@ if (empty($_GET['id']) || !is_number($_GET['id'])) {
6 6
 list($NumComments, $Page, $Thread) = Comments::load('torrents', (int)$_GET['id'], false);
7 7
 
8 8
 //---------- Begin printing
9
-$JsonComments = array();
9
+$JsonComments = [];
10 10
 foreach ($Thread as $Key => $Post) {
11 11
   list($PostID, $AuthorID, $AddedTime, $Body, $EditedUserID, $EditedTime, $EditedUsername) = array_values($Post);
12 12
   list($AuthorID, $Username, $PermissionID, $Paranoia, $Artist, $Donor, $Warned, $Avatar, $Enabled, $UserTitle) = array_values(Users::user_info($AuthorID));

+ 2
- 2
sections/ajax/top10/tags.php View File

@@ -16,7 +16,7 @@ if (isset($_GET['details'])) {
16 16
 // defaults to 10 (duh)
17 17
 $Limit = isset($_GET['limit']) ? intval($_GET['limit']) : 10;
18 18
 $Limit = in_array($Limit, array(10, 100, 250)) ? $Limit : 10;
19
-$OuterResults = array();
19
+$OuterResults = [];
20 20
 
21 21
 if ($Details == 'all' || $Details == 'ut') {
22 22
   if (!$TopUsedTags = $Cache->get_value("topusedtag_$Limit")) {
@@ -89,7 +89,7 @@ print
89 89
   );
90 90
 
91 91
 function generate_tag_json($Caption, $Tag, $Details, $Limit) {
92
-  $results = array();
92
+  $results = [];
93 93
   foreach ($Details as $Detail) {
94 94
     $results[] = array(
95 95
       'name' => $Detail['Name'],

+ 3
- 3
sections/ajax/top10/torrents.php View File

@@ -34,7 +34,7 @@ $BaseQuery = '
34 34
   FROM torrents AS t
35 35
     LEFT JOIN torrents_group AS g ON g.ID = t.GroupID';
36 36
 
37
-$OuterResults = array();
37
+$OuterResults = [];
38 38
 
39 39
 if ($Details == 'all' || $Details == 'day') {
40 40
   if (!$TopTorrentsActiveLastDay = $Cache->get_value('top10tor_day_'.$Limit.$WhereSum)) {
@@ -126,7 +126,7 @@ json_print("success", $OuterResults);
126 126
 
127 127
 function generate_torrent_json($Caption, $Tag, $Details, $Limit) {
128 128
   global $LoggedUser, $Categories;
129
-  $results = array();
129
+  $results = [];
130 130
   foreach ($Details as $Detail) {
131 131
     list($TorrentID, $GroupID, $GroupName, $GroupCategoryID, $WikiImage, $TorrentTags,
132 132
       $Media, $GroupYear,
@@ -134,7 +134,7 @@ function generate_torrent_json($Caption, $Tag, $Details, $Limit) {
134 134
 
135 135
     $Artist = Artists::display_artists(Artists::get_artist($GroupID), false, false);
136 136
 
137
-    $TagList = array();
137
+    $TagList = [];
138 138
 
139 139
     if ($TorrentTags != '') {
140 140
       $TorrentTags = explode(' ', $TorrentTags);

+ 2
- 2
sections/ajax/top10/users.php View File

@@ -33,7 +33,7 @@ $BaseQuery = "
33 33
     AND (Paranoia IS NULL OR (Paranoia NOT LIKE '%\"uploaded\"%' AND Paranoia NOT LIKE '%\"downloaded\"%'))
34 34
   GROUP BY u.ID";
35 35
 
36
-$OuterResults = array();
36
+$OuterResults = [];
37 37
 
38 38
 if ($Details == 'all' || $Details == 'ul') {
39 39
   if (!$TopUserUploads = $Cache->get_value("topuser_ul_$Limit")) {
@@ -104,7 +104,7 @@ print
104 104
   );
105 105
 
106 106
 function generate_user_json($Caption, $Tag, $Details, $Limit) {
107
-  $results = array();
107
+  $results = [];
108 108
   foreach ($Details as $Detail) {
109 109
     $results[] = array(
110 110
       'id' => (int)$Detail['ID'],

+ 1
- 1
sections/ajax/torrentgroup.php View File

@@ -64,7 +64,7 @@ $JsonTorrentDetails = array(
64 64
   'tags'            => $TagList
65 65
 );
66 66
 
67
-$JsonTorrentList = array();
67
+$JsonTorrentList = [];
68 68
 foreach ($TorrentList as $Torrent) {
69 69
   // Convert file list back to the old format
70 70
   $FileList = explode("\n", $Torrent['FileList']);

+ 1
- 1
sections/ajax/user.php View File

@@ -53,7 +53,7 @@ list($Username, $Email, $LastAccess, $IP, $Class, $Uploaded, $Downloaded, $Requi
53 53
 
54 54
 $Paranoia = unserialize($Paranoia);
55 55
 if (!is_array($Paranoia)) {
56
-  $Paranoia = array();
56
+  $Paranoia = [];
57 57
 }
58 58
 $ParanoiaLevel = 0;
59 59
 foreach ($Paranoia as $P) {

+ 1
- 1
sections/ajax/user_recents.php View File

@@ -8,7 +8,7 @@ if (empty($UserID) || $Limit > 50) {
8 8
 if (empty($Limit)) {
9 9
   $Limit = 15;
10 10
 }
11
-$Results = array();
11
+$Results = [];
12 12
 if (check_paranoia_here('snatched')) {
13 13
   $DB->query("
14 14
     SELECT

+ 1
- 1
sections/ajax/userhistory/post_history.php View File

@@ -154,7 +154,7 @@ if ($ShowGrouped) {
154 154
   $DB->set_query_id($Posts);
155 155
 }
156 156
 
157
-$JsonResults = array();
157
+$JsonResults = [];
158 158
 while (list($PostID, $AddedTime, $Body, $EditedUserID, $EditedTime, $EditedUsername, $TopicID, $ThreadTitle, $LastPostID, $LastRead, $Locked, $Sticky) = $DB->next_record()) {
159 159
   $JsonResults[] = array(
160 160
     'postId' => (int)$PostID,

+ 5
- 5
sections/artist/artist.php View File

@@ -68,7 +68,7 @@ if ($Data) {
68 68
 ob_start();
69 69
 
70 70
 // Requests
71
-$Requests = array();
71
+$Requests = [];
72 72
 if (empty($LoggedUser['DisableRequests'])) {
73 73
   $Requests = $Cache->get_value("artists_requests_$ArtistID");
74 74
   if (!is_array($Requests)) {
@@ -95,7 +95,7 @@ if (empty($LoggedUser['DisableRequests'])) {
95 95
     if ($DB->has_results()) {
96 96
       $Requests = $DB->to_array('ID', MYSQLI_ASSOC, false);
97 97
     } else {
98
-      $Requests = array();
98
+      $Requests = [];
99 99
     }
100 100
     $Cache->cache_value("artists_requests_$ArtistID", $Requests);
101 101
   }
@@ -116,7 +116,7 @@ if (($GroupIDs = $Cache->get_value("artist_groups_$ArtistID")) === false) {
116 116
 if (count($GroupIDs) > 0) {
117 117
   $TorrentList = Torrents::get_groups($GroupIDs, true, true);
118 118
 } else {
119
-  $TorrentList = array();
119
+  $TorrentList = [];
120 120
 }
121 121
 $NumGroups = count($TorrentList);
122 122
 
@@ -739,7 +739,7 @@ if ($NumRequests > 0) {
739 739
       }
740 740
 
741 741
       if (!empty($Tags[$RequestID])) {
742
-        $ReqTagList = array();
742
+        $ReqTagList = [];
743 743
         foreach ($Tags[$RequestID] as $TagID => $TagName) {
744 744
           $ReqTagList[] = "<a href=\"requests.php?tags=$TagName\">".display_str($TagName).'</a>';
745 745
         }
@@ -911,7 +911,7 @@ if ($RevisionID) {
911 911
   $Key = "artist_$ArtistID";
912 912
 }
913 913
 
914
-$Data = array(array($Name, $Image, $Body, $NumSimilar, $SimilarArray, array(), array(), $VanityHouseArtist));
914
+$Data = array(array($Name, $Image, $Body, $NumSimilar, $SimilarArray, [], [], $VanityHouseArtist));
915 915
 
916 916
 $Cache->cache_value($Key, $Data, 3600);
917 917
 ?>

+ 2
- 2
sections/artist/autocomplete.php View File

@@ -33,10 +33,10 @@ if (!$AutoSuggest) {
33 33
 }
34 34
 
35 35
 $Matched = 0;
36
-$ArtistIDs = array();
36
+$ArtistIDs = [];
37 37
 $Response = array(
38 38
   'query' => $FullName,
39
-  'suggestions' => array()
39
+  'suggestions' => []
40 40
 );
41 41
 foreach ($AutoSuggest as $Suggestion) {
42 42
   list($ID, $Name) = $Suggestion;

+ 4
- 4
sections/better/snatch.php View File

@@ -71,7 +71,7 @@ if (count($GroupIDs) === 0) {
71 71
 }
72 72
 
73 73
 $Groups = Torrents::get_groups(array_keys($GroupIDs));
74
-$TorrentGroups = array();
74
+$TorrentGroups = [];
75 75
 foreach ($Groups as $GroupID => $Group) {
76 76
   if (empty($Group['Torrents'])) {
77 77
     unset($Groups[$GroupID]);
@@ -83,7 +83,7 @@ foreach ($Groups as $GroupID => $Group) {
83 83
       $TorrentGroups[$Group['ID']] = array(
84 84
         $TorRemIdent => array(
85 85
           'FlacID' => 0,
86
-          'Formats' => array(),
86
+          'Formats' => [],
87 87
           'IsSnatched' => $Torrent['IsSnatched'],
88 88
           'Medium' => $Torrent['Media'],
89 89
           'RemasterTitle' => $Torrent['RemasterTitle'],
@@ -95,7 +95,7 @@ foreach ($Groups as $GroupID => $Group) {
95 95
     } elseif (!isset($TorrentGroups[$Group['ID']][$TorRemIdent])) {
96 96
       $TorrentGroups[$Group['ID']][$TorRemIdent] = array(
97 97
         'FlacID' => 0,
98
-        'Formats' => array(),
98
+        'Formats' => [],
99 99
         'IsSnatched' => $Torrent['IsSnatched'],
100 100
         'Medium' => $Torrent['Media'],
101 101
         'RemasterTitle' => $Torrent['RemasterTitle'],
@@ -194,7 +194,7 @@ foreach ($TorrentGroups as $GroupID => $Editions) {
194 194
     }
195 195
     $DisplayName .= ' ['.$Edition['Medium'].']';
196 196
 
197
-    $EditionInfo = array();
197
+    $EditionInfo = [];
198 198
     if (!empty($Edition['RemasterYear'])) {
199 199
       $ExtraInfo = $Edition['RemasterYear'];
200 200
     } else {

+ 4
- 4
sections/better/transcode.php View File

@@ -36,7 +36,7 @@ if ($TorrentCount == 0) {
36 36
 
37 37
 $Results = $SphQLResult->to_array('groupid');
38 38
 $Groups = Torrents::get_groups(array_keys($Results));
39
-$TorrentGroups = array();
39
+$TorrentGroups = [];
40 40
 foreach ($Groups as $GroupID => $Group) {
41 41
   if (empty($Group['Torrents'])) {
42 42
     unset($Groups[$GroupID]);
@@ -48,7 +48,7 @@ foreach ($Groups as $GroupID => $Group) {
48 48
       $TorrentGroups[$Group['ID']] = array(
49 49
         $TorRemIdent => array(
50 50
           'FlacID' => 0,
51
-          'Formats' => array(),
51
+          'Formats' => [],
52 52
           'RemasterTitle' => $Torrent['RemasterTitle'],
53 53
           'RemasterYear' => $Torrent['RemasterYear'],
54 54
           'RemasterRecordLabel' => $Torrent['RemasterRecordLabel'],
@@ -59,7 +59,7 @@ foreach ($Groups as $GroupID => $Group) {
59 59
     } elseif (!isset($TorrentGroups[$Group['ID']][$TorRemIdent])) {
60 60
       $TorrentGroups[$Group['ID']][$TorRemIdent] = array(
61 61
         'FlacID' => 0,
62
-        'Formats' => array(),
62
+        'Formats' => [],
63 63
         'RemasterTitle' => $Torrent['RemasterTitle'],
64 64
         'RemasterYear' => $Torrent['RemasterYear'],
65 65
         'RemasterRecordLabel' => $Torrent['RemasterRecordLabel'],
@@ -142,7 +142,7 @@ foreach ($TorrentGroups as $GroupID => $Editions) {
142 142
       $DisplayName .= ' ' . Format::torrent_label('Snatched!');
143 143
     }
144 144
 
145
-    $EditionInfo = array();
145
+    $EditionInfo = [];
146 146
     if (!empty($Edition['RemasterYear'])) {
147 147
       $ExtraInfo = $Edition['RemasterYear'];
148 148
     } else {

+ 5
- 5
sections/better/transcode_beta.php View File

@@ -53,7 +53,7 @@ function transcode_init_sphql() {
53 53
 }
54 54
 
55 55
 function transcode_parse_groups($Groups) {
56
-  $TorrentGroups = array();
56
+  $TorrentGroups = [];
57 57
   foreach ($Groups as $GroupID => $Group) {
58 58
     if (empty($Group['Torrents'])) {
59 59
       continue;
@@ -67,7 +67,7 @@ function transcode_parse_groups($Groups) {
67 67
           'Name' => $Group['Name'],
68 68
           'ReleaseType' => $Group['ReleaseType'],
69 69
           'TagList' => $Group['TagList'],
70
-          'Editions' => array()
70
+          'Editions' => []
71 71
         );
72 72
       }
73 73
       if (!isset($TorrentGroups[$GroupID]['Editions'][$RemIdent])) {
@@ -105,8 +105,8 @@ function transcode_parse_groups($Groups) {
105 105
           $EditionName .= $AddExtra.display_str($Torrent['Media']);
106 106
         }
107 107
         $TorrentGroups[$GroupID]['Editions'][$RemIdent] = array(
108
-          'FlacIDs' => array(),
109
-          'MP3s' => array(),
108
+          'FlacIDs' => [],
109
+          'MP3s' => [],
110 110
           'Media' => $Torrent['Media'],
111 111
           'EditionName' => $EditionName,
112 112
           'FLACIsSnatched' => false
@@ -125,7 +125,7 @@ function transcode_parse_groups($Groups) {
125 125
   return $TorrentGroups;
126 126
 }
127 127
 
128
-$Groups = array();
128
+$Groups = [];
129 129
 $ResultCount = 0;
130 130
 if (in_array($_GET['filter'], array('all', 'uploaded'))) {
131 131
   $SphQL = transcode_init_sphql();

+ 4
- 4
sections/better/upload.php View File

@@ -59,7 +59,7 @@ if (count($GroupIDs) === 0) {
59 59
 }
60 60
 
61 61
 $Groups = Torrents::get_groups(array_keys($GroupIDs));
62
-$TorrentGroups = array();
62
+$TorrentGroups = [];
63 63
 foreach ($Groups as $GroupID => $Group) {
64 64
   if (empty($Group['Torrents'])) {
65 65
     unset($Groups[$GroupID]);
@@ -71,7 +71,7 @@ foreach ($Groups as $GroupID => $Group) {
71 71
       $TorrentGroups[$Group['ID']] = array(
72 72
         $TorRemIdent => array(
73 73
           'FlacID' => 0,
74
-          'Formats' => array(),
74
+          'Formats' => [],
75 75
           'IsSnatched' => $Torrent['IsSnatched'],
76 76
           'Medium' => $Torrent['Media'],
77 77
           'RemasterTitle' => $Torrent['RemasterTitle'],
@@ -83,7 +83,7 @@ foreach ($Groups as $GroupID => $Group) {
83 83
     } elseif (!isset($TorrentGroups[$Group['ID']][$TorRemIdent])) {
84 84
       $TorrentGroups[$Group['ID']][$TorRemIdent] = array(
85 85
         'FlacID' => 0,
86
-        'Formats' => array(),
86
+        'Formats' => [],
87 87
         'IsSnatched' => $Torrent['IsSnatched'],
88 88
         'Medium' => $Torrent['Media'],
89 89
         'RemasterTitle' => $Torrent['RemasterTitle'],
@@ -173,7 +173,7 @@ foreach ($TorrentGroups as $GroupID => $Editions) {
173 173
     }
174 174
     $DisplayName .= ' ['.$Edition['Medium'].']';
175 175
 
176
-    $EditionInfo = array();
176
+    $EditionInfo = [];
177 177
     if (!empty($Edition['RemasterYear'])) {
178 178
       $ExtraInfo = $Edition['RemasterYear'];
179 179
     } else {

+ 3
- 3
sections/bookmarks/torrents.php View File

@@ -30,11 +30,11 @@ $Title = $Sneaky ? "$Username's bookmarked torrent groups" : 'Your bookmarked to
30 30
 
31 31
 // Loop through the result set, building up $Collage and $TorrentTable
32 32
 // Then we print them.
33
-$Collage = array();
33
+$Collage = [];
34 34
 $TorrentTable = '';
35 35
 
36 36
 $NumGroups = 0;
37
-$ArtistCount = array();
37
+$ArtistCount = [];
38 38
 
39 39
 list($GroupIDs, $CollageDataList, $TorrentList) = Users::get_bookmarks($UserID);
40 40
 foreach ($GroupIDs as $GroupID) {
@@ -269,7 +269,7 @@ foreach ($GroupIDs as $GroupID) {
269 269
 }
270 270
 
271 271
 $CollageCovers = isset($LoggedUser['CollageCovers']) ? (int)$LoggedUser['CollageCovers'] : 10;
272
-$CollagePages = array();
272
+$CollagePages = [];
273 273
 for ($i = 0; $i < $NumGroups / $CollageCovers; $i++) {
274 274
   $Groups = array_slice($Collage, $i * $CollageCovers, $CollageCovers);
275 275
   $CollagePage = '';

+ 2
- 2
sections/collages/add_artist.php View File

@@ -114,7 +114,7 @@ if ($_REQUEST['action'] == 'add_artist') {
114 114
   add_artist($CollageID, $ArtistID);
115 115
 } else {
116 116
   $URLs = explode("\n", $_REQUEST['urls']);
117
-  $ArtistIDs = array();
117
+  $ArtistIDs = [];
118 118
   $Err = '';
119 119
   foreach ($URLs as $Key => &$URL) {
120 120
     $URL = trim($URL);
@@ -134,7 +134,7 @@ if ($_REQUEST['action'] == 'add_artist') {
134 134
   }
135 135
 
136 136
   foreach ($URLs as $URL) {
137
-    $Matches = array();
137
+    $Matches = [];
138 138
     if (preg_match('/^'.ARTIST_REGEX.'/i', $URL, $Matches)) {
139 139
       $ArtistIDs[] = $Matches[4];
140 140
       $ArtistID = $Matches[4];

+ 2
- 2
sections/collages/add_torrent.php View File

@@ -114,7 +114,7 @@ if ($_REQUEST['action'] == 'add_torrent') {
114 114
   add_torrent($CollageID, $GroupID);
115 115
 } else {
116 116
   $URLs = explode("\n", $_REQUEST['urls']);
117
-  $GroupIDs = array();
117
+  $GroupIDs = [];
118 118
   $Err = '';
119 119
   foreach ($URLs as $Key => &$URL) {
120 120
     $URL = trim($URL);
@@ -134,7 +134,7 @@ if ($_REQUEST['action'] == 'add_torrent') {
134 134
   }
135 135
 
136 136
   foreach ($URLs as $URL) {
137
-    $Matches = array();
137
+    $Matches = [];
138 138
     if (preg_match('/^'.TORRENT_GROUP_REGEX.'/i', $URL, $Matches)) {
139 139
       $GroupIDs[] = $Matches[4];
140 140
       $GroupID = $Matches[4];

+ 3
- 3
sections/collages/artist_collage.php View File

@@ -16,12 +16,12 @@ $Artists = $DB->to_array('ArtistID', MYSQLI_ASSOC);
16 16
 
17 17
 // Loop through the result set, building up $Collage and $TorrentTable
18 18
 // Then we print them.
19
-$Collage = array();
19
+$Collage = [];
20 20
 $ArtistTable = '';
21 21
 
22 22
 $NumGroups = count($Artists);
23 23
 $NumGroupsByUser = 0;
24
-$UserAdditions = array();
24
+$UserAdditions = [];
25 25
 
26 26
 foreach ($Artists as $Artist) {
27 27
   $UserID = $Artist['UserID'];
@@ -64,7 +64,7 @@ if (!check_perms('site_collages_delete') && ($Locked || ($MaxGroups > 0 && $NumG
64 64
 
65 65
 // Silly hack for people who are on the old setting
66 66
 $CollageCovers = (isset($LoggedUser['CollageCovers']) ? $LoggedUser['CollageCovers'] : 25 * (abs($LoggedUser['HideCollage'] - 1)));
67
-$CollagePages = array();
67
+$CollagePages = [];
68 68
 
69 69
 // Pad it out
70 70
 if ($NumGroups > $CollageCovers) {

+ 1
- 1
sections/collages/manage.php View File

@@ -35,7 +35,7 @@ $CollageDataList = $DB->to_array('GroupID', MYSQLI_ASSOC);
35 35
 if (count($GroupIDs) > 0) {
36 36
   $TorrentList = Torrents::get_groups($GroupIDs);
37 37
 } else {
38
-  $TorrentList = array();
38
+  $TorrentList = [];
39 39
 }
40 40
 
41 41
 View::show_header("Manage collection: $Name", 'jquery-ui,jquery.tablesorter,sort');

+ 1
- 1
sections/collages/manage_artists_handle.php View File

@@ -41,7 +41,7 @@ if ($_POST['submit'] === 'Remove') {
41 41
   @parse_str($_POST['drag_drop_collage_sort_order'], $Series);
42 42
   $Series = @array_shift($Series);
43 43
   if (is_array($Series)) {
44
-    $SQL = array();
44
+    $SQL = [];
45 45
     foreach ($Series as $Sort => $ArtistID) {
46 46
       if (is_number($Sort) && is_number($ArtistID)) {
47 47
         $Sort = ($Sort + 1) * 10;

+ 1
- 1
sections/collages/manage_handle.php View File

@@ -40,7 +40,7 @@ if ($_POST['submit'] === 'Remove') {
40 40
   @parse_str($_POST['drag_drop_collage_sort_order'], $Series);
41 41
   $Series = @array_shift($Series);
42 42
   if (is_array($Series)) {
43
-    $SQL = array();
43
+    $SQL = [];
44 44
     foreach ($Series as $Sort => $GroupID) {
45 45
       if (is_number($Sort) && is_number($GroupID)) {
46 46
         $Sort = ($Sort + 1) * 10;

+ 1
- 1
sections/collages/new_handle.php View File

@@ -4,7 +4,7 @@ authorize();
4 4
 include(SERVER_ROOT.'/classes/validate.class.php');
5 5
 $Val = new VALIDATE;
6 6
 
7
-$P = array();
7
+$P = [];
8 8
 $P = db_array($_POST);
9 9
 
10 10
 if ($P['category'] > 0 || check_perms('site_collages_renamepersonal')) {

+ 5
- 5
sections/collages/torrent_collage.php View File

@@ -20,18 +20,18 @@ if (count($GroupIDs) > 0) {
20 20
   $TorrentList = Torrents::get_groups($GroupIDs);
21 21
   $UserVotes = Votes::get_user_votes($LoggedUser['ID']);
22 22
 } else {
23
-  $TorrentList = array();
23
+  $TorrentList = [];
24 24
 }
25 25
 
26 26
 // Loop through the result set, building up $Collage and $TorrentTable
27 27
 // Then we print them.
28
-$Collage = array();
28
+$Collage = [];
29 29
 $TorrentTable = '';
30 30
 
31 31
 $NumGroups = count($TorrentList);
32 32
 $NumGroupsByUser = 0;
33
-$TopArtists = array();
34
-$UserAdditions = array();
33
+$TopArtists = [];
34
+$UserAdditions = [];
35 35
 $Number = 0;
36 36
 
37 37
 foreach ($GroupIDs as $GroupID) {
@@ -272,7 +272,7 @@ if (!check_perms('site_collages_delete')
272 272
 
273 273
 // Silly hack for people who are on the old setting
274 274
 $CollageCovers = isset($LoggedUser['CollageCovers']) ? $LoggedUser['CollageCovers'] : 25 * (abs($LoggedUser['HideCollage'] - 1));
275
-$CollagePages = array();
275
+$CollagePages = [];
276 276
 
277 277
 for ($i = 0; $i < $NumGroups / $CollageCovers; $i++) {
278 278
   $Groups = array_slice($Collage, $i * $CollageCovers, $CollageCovers);

+ 3
- 3
sections/comments/comments.php View File

@@ -56,7 +56,7 @@ if (!isset($_REQUEST['type'])) {
56 56
 }
57 57
 
58 58
 // Construct the SQL query
59
-$Conditions = $Join = array();
59
+$Conditions = $Join = [];
60 60
 switch ($Action) {
61 61
   case 'artist':
62 62
     $Field1 = 'artists_group.ArtistID';
@@ -167,7 +167,7 @@ $Pages = Format::get_pages($Page, $Results, $PerPage, 11);
167 167
 $DB->set_query_id($Comments);
168 168
 if ($Action == 'requests') {
169 169
   $RequestIDs = array_flip(array_flip($DB->collect('PageID')));
170
-  $Artists = array();
170
+  $Artists = [];
171 171
   foreach ($RequestIDs as $RequestID) {
172 172
     $Artists[$RequestID] = Requests::get_artists($RequestID);
173 173
   }
@@ -179,7 +179,7 @@ if ($Action == 'requests') {
179 179
 }
180 180
 
181 181
 $LinkID = (!$Self ? '&amp;id=' . $UserID : '');
182
-$ActionLinks = $TypeLinks = array();
182
+$ActionLinks = $TypeLinks = [];
183 183
 if ($Action != 'artist') {
184 184
   $ActionLinks[] = '<a href="comments.php?action=artist' . $LinkID . '" class="brackets">Artist comments</a>';
185 185
 }

+ 1
- 1
sections/forums/forum.php View File

@@ -198,7 +198,7 @@ if (count($Forum) === 0) {
198 198
     list($TopicID, $Title, $AuthorID, $Locked, $Sticky, $PostCount, $LastID, $LastTime, $LastAuthorID) = array_values($Topic);
199 199
     // Build list of page links
200 200
     // Only do this if there is more than one page
201
-    $PageLinks = array();
201
+    $PageLinks = [];
202 202
     $ShownEllipses = false;
203 203
     $PagesText = '';
204 204
     $TopicPages = ceil($PostCount / $PerPage);

+ 0
- 0
sections/forums/poll_mod.php View File


Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save