7 Commits

Author SHA1 Message Date
  biotorrents 49cffc7ca5 Draft the About page and use prepared queries on reportsv2 4 years ago
  biotorrents 51f318ea42 More prepared queries, friends feature, etc. 4 years ago
  biotorrents 3beb50fa32 Text class redux 4 years ago
  biotorrents e625d03a3b Wikipedia style links, fix alertbar style, organize public header/footer, add about page 4 years ago
  biotorrents 303ae78d4b Remove bbcode.js and donor_titles.js 4 years ago
  biotorrents 0a21914f54 Fix "fix ghost entry" feature and use prepared queries on some classes 4 years ago
  biotorrents b2ff1c1d5e Remove the rest of the user history stuff (nothing to expunge) 4 years ago
86 changed files with 433 additions and 712 deletions
  1. 10
    10
      classes/artists.class.php
  2. 2
    2
      classes/badges.class.php
  3. 1
    1
      classes/bookmarks.class.php
  4. 4
    4
      classes/collages.class.php
  5. 55
    38
      classes/text.class.php
  6. 2
    2
      classes/wiki.class.php
  7. 2
    16
      design/privateheader.php
  8. 2
    2
      design/publicfooter.php
  9. 2
    8
      design/publicheader.php
  10. 0
    10
      gazelle.sql
  11. 1
    1
      sections/artist/artist.php
  12. 1
    1
      sections/collages/all_comments.php
  13. 1
    1
      sections/collages/artist_collage.php
  14. 1
    1
      sections/collages/edit.php
  15. 1
    1
      sections/collages/new.php
  16. 1
    1
      sections/collages/torrent_collage.php
  17. 1
    1
      sections/comments/comments.php
  18. 1
    1
      sections/forums/newthread.php
  19. 1
    1
      sections/forums/search.php
  20. 4
    4
      sections/forums/take_warn.php
  21. 12
    12
      sections/forums/thread.php
  22. 3
    3
      sections/forums/warn.php
  23. 17
    13
      sections/friends/add.php
  24. 9
    7
      sections/friends/comment.php
  25. 4
    4
      sections/friends/friends.php
  26. 17
    15
      sections/friends/index.php
  27. 8
    6
      sections/friends/remove.php
  28. 3
    3
      sections/inbox/compose.php
  29. 1
    1
      sections/inbox/conversation.php
  30. 6
    0
      sections/legal/index.php
  31. 1
    1
      sections/reports/compose.php
  32. 1
    1
      sections/reports/report.php
  33. 1
    1
      sections/reports/reports.php
  34. 3
    3
      sections/reportsv2/ajax_create_report.php
  35. 2
    2
      sections/reportsv2/ajax_giveback_report.php
  36. 1
    1
      sections/reportsv2/ajax_grab_report.php
  37. 7
    7
      sections/reportsv2/ajax_new_report.php
  38. 2
    2
      sections/reportsv2/ajax_update_comment.php
  39. 1
    1
      sections/reportsv2/ajax_update_resolve.php
  40. 2
    2
      sections/reportsv2/report.php
  41. 12
    12
      sections/reportsv2/static.php
  42. 74
    82
      sections/reportsv2/takereport.php
  43. 19
    19
      sections/reportsv2/takeresolve.php
  44. 7
    7
      sections/reportsv2/views.php
  45. 1
    1
      sections/requests/new_edit.php
  46. 1
    1
      sections/requests/request.php
  47. 1
    1
      sections/staffpm/viewconv.php
  48. 4
    4
      sections/tools/finances/donation_log.php
  49. 2
    2
      sections/tools/finances/donor_rewards.php
  50. 0
    4
      sections/tools/index.php
  51. 3
    3
      sections/tools/managers/bans.php
  52. 2
    2
      sections/tools/managers/email_blacklist.php
  53. 3
    3
      sections/tools/managers/email_blacklist_alter.php
  54. 1
    1
      sections/tools/managers/email_blacklist_search.php
  55. 0
    108
      sections/tools/managers/expunge_requests.php
  56. 1
    1
      sections/tools/managers/mass_pm.php
  57. 1
    1
      sections/tools/managers/news.php
  58. 4
    4
      sections/tools/misc/create_user.php
  59. 1
    1
      sections/top10/donors.php
  60. 1
    1
      sections/top10/history.php
  61. 2
    2
      sections/top10/tags.php
  62. 8
    8
      sections/top10/torrents.php
  63. 5
    5
      sections/top10/users.php
  64. 1
    1
      sections/torrents/details.php
  65. 1
    1
      sections/torrents/edit.php
  66. 1
    1
      sections/torrents/editgroup.php
  67. 7
    3
      sections/torrents/index.php
  68. 1
    1
      sections/upload/upload.php
  69. 1
    1
      sections/user/edit.php
  70. 1
    1
      sections/user/user.php
  71. 1
    1
      sections/userhistory/post_history.php
  72. 1
    1
      sections/userhistory/subscriptions.php
  73. 1
    1
      sections/wiki/article.php
  74. 1
    1
      sections/wiki/create.php
  75. 1
    1
      sections/wiki/edit.php
  76. 6
    0
      static/common/symbols/external-link-ltr-icon.svg
  77. BIN
      static/common/symbols/external.png
  78. 0
    142
      static/functions/bbcode.js
  79. 0
    33
      static/functions/donor_titles.js
  80. 8
    6
      static/styles/bookish/scss/colors.scss
  81. 8
    0
      static/styles/global/scss/fonts.scss
  82. 38
    0
      templates/legal/about.html
  83. 3
    3
      templates/legal/dmca.html
  84. 5
    5
      templates/legal/privacy.html
  85. 0
    29
      templates/staffblog/edit.twig
  86. 0
    16
      templates/staffblog/list.twig

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

@@ -47,7 +47,7 @@ class Artists
47 47
             }
48 48
 
49 49
             $QueryID = G::$DB->get_query_id();
50
-            G::$DB->query("
50
+            G::$DB->prepared_query("
51 51
             SELECT
52 52
               ta.`GroupID`,
53 53
               ta.`ArtistID`,
@@ -169,7 +169,7 @@ class Artists
169 169
     public static function delete_artist($ArtistID)
170 170
     {
171 171
         $QueryID = G::$DB->get_query_id();
172
-        G::$DB->query("
172
+        G::$DB->prepared_query("
173 173
         SELECT
174 174
           `NAME`
175 175
         FROM
@@ -180,7 +180,7 @@ class Artists
180 180
         list($Name) = G::$DB->next_record(MYSQLI_NUM, false);
181 181
 
182 182
         // Delete requests
183
-        G::$DB->query("
183
+        G::$DB->prepared_query("
184 184
         SELECT
185 185
           `RequestID`
186 186
         FROM
@@ -192,7 +192,7 @@ class Artists
192 192
         $Requests = G::$DB->to_array();
193 193
         foreach ($Requests as $Request) {
194 194
             list($RequestID) = $Request;
195
-            G::$DB->query("
195
+            G::$DB->prepared_query("
196 196
             DELETE
197 197
             FROM
198 198
               `requests`
@@ -200,7 +200,7 @@ class Artists
200 200
               `ID` = '$RequestID'
201 201
             ");
202 202
 
203
-            G::$DB->query("
203
+            G::$DB->prepared_query("
204 204
             DELETE
205 205
             FROM
206 206
               `requests_votes`
@@ -208,7 +208,7 @@ class Artists
208 208
               `RequestID` = '$RequestID'
209 209
             ");
210 210
 
211
-            G::$DB->query("
211
+            G::$DB->prepared_query("
212 212
             DELETE
213 213
             FROM
214 214
               `requests_tags`
@@ -216,7 +216,7 @@ class Artists
216 216
               `RequestID` = '$RequestID'
217 217
             ");
218 218
 
219
-            G::$DB->query("
219
+            G::$DB->prepared_query("
220 220
             DELETE
221 221
             FROM
222 222
               `requests_artists`
@@ -226,7 +226,7 @@ class Artists
226 226
         }
227 227
 
228 228
         // Delete artist
229
-        G::$DB->query("
229
+        G::$DB->prepared_query("
230 230
         DELETE
231 231
         FROM
232 232
           `artists_group`
@@ -236,7 +236,7 @@ class Artists
236 236
         G::$Cache->decrement('stats_artist_count');
237 237
 
238 238
         // Delete wiki revisions
239
-        G::$DB->query("
239
+        G::$DB->prepared_query("
240 240
         DELETE
241 241
         FROM
242 242
           `wiki_artists`
@@ -245,7 +245,7 @@ class Artists
245 245
         ");
246 246
 
247 247
         // Delete tags
248
-        G::$DB->query("
248
+        G::$DB->prepared_query("
249 249
         DELETE
250 250
         FROM
251 251
           `artists_tags`

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

@@ -28,7 +28,7 @@ class Badges
28 28
             return false;
29 29
         } else {
30 30
             $QueryID = G::$DB->get_query_id();
31
-            G::$DB->query("
31
+            G::$DB->prepared_query("
32 32
             INSERT INTO `users_badges`(`UserID`, `BadgeID`)
33 33
             VALUES($UserID, $BadgeID)
34 34
             ");
@@ -126,7 +126,7 @@ class Badges
126 126
     {
127 127
         $QueryID = G::$DB->get_query_id();
128 128
 
129
-        G::$DB->query("
129
+        G::$DB->prepared_query("
130 130
         SELECT
131 131
           `ID`,
132 132
           `Icon`,

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

@@ -97,7 +97,7 @@ class Bookmarks
97 97
             list($Table, $Col) = self::bookmark_schema($Type);
98 98
             $QueryID = G::$DB->get_query_id();
99 99
 
100
-            G::$DB->query("
100
+            G::$DB->prepared_query("
101 101
             SELECT `$Col`
102 102
             FROM `$Table`
103 103
               WHERE UserID = '$UserID'");

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

@@ -6,7 +6,7 @@ class Collages
6 6
     public static function increase_subscriptions($CollageID)
7 7
     {
8 8
         $QueryID = G::$DB->get_query_id();
9
-        G::$DB->query("
9
+        G::$DB->prepared_query("
10 10
         UPDATE
11 11
           `collages`
12 12
         SET
@@ -20,7 +20,7 @@ class Collages
20 20
     public static function decrease_subscriptions($CollageID)
21 21
     {
22 22
         $QueryID = G::$DB->get_query_id();
23
-        G::$DB->query("
23
+        G::$DB->prepared_query("
24 24
         UPDATE
25 25
           `collages`
26 26
         SET
@@ -37,7 +37,7 @@ class Collages
37 37
 
38 38
     public static function create_personal_collage()
39 39
     {
40
-        G::$DB->query("
40
+        G::$DB->prepared_query("
41 41
         SELECT
42 42
           COUNT(`ID`)
43 43
         FROM
@@ -57,7 +57,7 @@ class Collages
57 57
         $NameStr = db_string(G::$LoggedUser['Username']."'s personal collage".($CollageCount > 0 ? ' no. '.($CollageCount + 1) : ''));
58 58
         $Description = db_string('Personal collage for '.G::$LoggedUser['Username'].'. The first 5 albums will appear on his or her [url='.site_url().'user.php?id= '.G::$LoggedUser['ID'].']profile[/url].');
59 59
 
60
-        G::$DB->query("
60
+        G::$DB->prepared_query("
61 61
         INSERT INTO `collages`(
62 62
           `Name`,
63 63
           `Description`,

+ 55
- 38
classes/text.class.php View File

@@ -14,8 +14,6 @@ class Text
14 14
       's' => 0,
15 15
       '*' => 0,
16 16
       '#' => 0,
17
-      #'ch' => 0,
18
-      #'uch' => 0,
19 17
       'artist' => 0,
20 18
       'user' => 0,
21 19
       'n' => 0,
@@ -128,7 +126,41 @@ class Text
128 126
      */
129 127
     public static $TOC = false;
130 128
 
129
+
130
+    /**
131
+     * Fix the links
132
+     * 
133
+     * Make it so that internal links are in the form "/section?p=foo"
134
+     * and that external links are secure and look like Wikipedia.
135
+     * Takes an already-parsed input, to hit Markdown and BBcode.
136
+     */
137
+    public function fix_links($Parsed) {
138
+            # Replace links to $ENV->SITE_DOMAIN
139
+            $Parsed = preg_replace(
140
+                "/<a href=\"$ENV->RESOURCE_REGEX$ENV->SITE_DOMAIN\//",
141
+                '<a href="/',
142
+                $Parsed
143
+            );
144
+                
145
+            # Replace external links and add Wikipedia-style CSS class
146
+            $RelTags = 'external nofollow noopener noreferrer';
147
+
148
+            $Parsed = preg_replace(
149
+                '/<a href="https?:\/\//',
150
+                '<a class="external" rel="'.$RelTags.'" target="_blank" href="https://',
151
+                $Parsed
152
+            );
153
+
154
+            $Parsed = preg_replace(
155
+                '/<a href="ftps?:\/\//',
156
+                '<a class="external" rel="'.$RelTags.'" target="_blank" href="ftps://',
157
+                $Parsed
158
+            );
159
+
160
+            return $Parsed;       
161
+    }
131 162
     
163
+
132 164
     /**
133 165
      * Output BBCode as XHTML
134 166
      *
@@ -152,8 +184,18 @@ class Text
152 184
         )) {
153 185
             $Parsedown = new ParsedownExtra();
154 186
             $Parsedown->setSafeMode(true);
187
+
188
+            # Prepare clean escapes
155 189
             $Str = html_entity_decode($Str, ENT_QUOTES | ENT_HTML5, 'UTF-8');
156 190
 
191
+            # Parse early and post-process
192
+            $Parsed = $Parsedown->text($Str);
193
+            
194
+            # Replace links to $ENV->SITE_DOMAIN
195
+            $Parsed = self::fix_links($Parsed);
196
+
197
+            return $Parsed;
198
+
157 199
             # Markdown ToC not happening yet
158 200
             # Shouldn't parse_toc() output HTML
159 201
             /*
@@ -174,8 +216,6 @@ class Text
174 216
             }
175 217
             */
176 218
 
177
-            return $P = $Parsedown->text($Str);
178
-
179 219
         /*
180 220
         return $P =
181 221
             ((self::$TOC && $OutputTOC)
@@ -183,37 +223,24 @@ class Text
183 223
                 : null)
184 224
             . $Parsedown->text($Str);
185 225
         */
186
-        } else {
226
+        }
227
+        
228
+        /**
229
+         * BBcode formatting
230
+         */
231
+        else {
187 232
             global $Debug;
188 233
             $Debug->set_flag('BBCode start');
189 234
 
190 235
             self::$Headlines = [];
191 236
             $Str = display_str($Str);
192 237
 
193
-            # Checkboxes: broken and stupid
194
-            /*
195
-            $Str = preg_replace('/\[\\[(ch|uch)]\]/i', '', $Str);
196
-            $Str = preg_replace('/\[ch\]/i', '[ch][/ch]', $Str);
197
-            $Str = preg_replace('/\[uch\]/i', '[uch][/uch]', $Str);
198
-            */
199
-
200 238
             // Inline links
201 239
             $URLPrefix = '(\[url\]|\[url\=|\[img\=|\[img\])';
202 240
             $Str = preg_replace('/'.$URLPrefix.'\s+/i', '$1', $Str);
203 241
             $Str = preg_replace('/(?<!'.$URLPrefix.')http(s)?:\/\//i', '$1[inlineurl]http$2://', $Str);
204 242
             $Str = preg_replace('/\[embed\]\[inlineurl\]/', '[embed]', $Str);
205 243
 
206
-            // For anonym.to and archive.org links, remove any [inlineurl] in the middle of the link
207
-            /*
208
-            $Str = preg_replace_callback(
209
-                '/(?<=\[inlineurl\]|'.$URLPrefix.')(\S*\[inlineurl\]\S*)/m',
210
-                function ($matches) {
211
-                    return str_replace("[inlineurl]", "", $matches[0]);
212
-                },
213
-                $Str
214
-            );
215
-            */
216
-
217 244
             if (self::$TOC) {
218 245
                 $Str = preg_replace('/(\={5})([^=].*)\1/i', '[headline=4]$2[/headline]', $Str);
219 246
                 $Str = preg_replace('/(\={4})([^=].*)\1/i', '[headline=3]$2[/headline]', $Str);
@@ -233,6 +260,9 @@ class Text
233 260
                 $HTML = self::parse_toc($Min) . $HTML;
234 261
             }
235 262
 
263
+            # Rewrite the URLs
264
+            $HTML = self::fix_links($HTML);
265
+
236 266
             $Debug->set_flag('BBCode end');
237 267
             return $HTML;
238 268
         }
@@ -871,20 +901,6 @@ class Text
871 901
                   break;
872 902
 
873 903
 
874
-                /*
875
-                case 'ch':
876
-                  $Str .= '<input type="checkbox" checked="checked" disabled="disabled">';
877
-                  break;
878
-                */
879
-
880
-
881
-                /*
882
-                case 'uch':
883
-                  $Str .= '<input type="checkbox" disabled="disabled">';
884
-                  break;
885
-                */
886
-
887
-
888 904
                 case 'list':
889 905
                   $Str .= "<$Block[ListType] class=\"postlist\">";
890 906
                   foreach ($Block['Val'] as $Line) {
@@ -1051,7 +1067,8 @@ class Text
1051 1067
                       if ($LocalURL) {
1052 1068
                           $Str .= '<a href="'.$LocalURL.'">'.substr($LocalURL, 1).'</a>';
1053 1069
                       } else {
1054
-                          $Str .= '<a rel="noreferrer" target="_blank" href="'.$Block['Attr'].'">'.$Block['Attr'].'</a>';
1070
+                          $Str .= '<a href="'.$Block['Attr'].'">'.$Block['Attr'].'</a>';
1071
+                          #$Str .= '<a rel="noreferrer" target="_blank" href="'.$Block['Attr'].'">'.$Block['Attr'].'</a>';
1055 1072
                       }
1056 1073
                   }
1057 1074
                   break;

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

@@ -22,7 +22,7 @@ class Wiki
22 22
         $Aliases = G::$Cache->get_value('wiki_aliases');
23 23
         if (!$Aliases) {
24 24
             $QueryID = G::$DB->get_query_id();
25
-            G::$DB->query("
25
+            G::$DB->prepared_query("
26 26
             SELECT Alias, ArticleID
27 27
             FROM wiki_aliases");
28 28
             $Aliases = G::$DB->to_pair('Alias', 'ArticleID');
@@ -67,7 +67,7 @@ class Wiki
67 67
         $Contents = G::$Cache->get_value('wiki_article_'.$ArticleID);
68 68
         if (!$Contents) {
69 69
             $QueryID = G::$DB->get_query_id();
70
-            G::$DB->query("
70
+            G::$DB->prepared_query("
71 71
             SELECT
72 72
               w.Revision,
73 73
               w.Title,

+ 2
- 16
design/privateheader.php View File

@@ -252,8 +252,7 @@ if ($NotificationsManager->is_skipped(NotificationsManager::SUBSCRIPTIONS)) {
252 252
           <li id="nav_irc" <?=
253 253
             Format::add_class($PageID, ['chat'], 'active', true)?>>
254 254
             <a href="https://join.slack.com/t/biotorrents/shared_invite/<?=$ENV->SLACK_INVITE?>"
255
-              target="_blank">Slack
256
-              <img src="/static/common/symbols/external.png" style="height: 0.75em; vertical-align: center;" /></a>
255
+              target="_blank">Slack</a>
257 256
           </li>
258 257
 
259 258
           <li id="nav_top10" <?=
@@ -609,19 +608,6 @@ if (check_perms('admin_reports')) {
609 608
     }
610 609
 }
611 610
 
612
-if (check_perms('users_mod')) {
613
-    $NumDeleteRequests = G::$Cache->get_value('num_deletion_requests');
614
-    if ($NumDeleteRequests === false) {
615
-        G::$DB->query("SELECT COUNT(*) FROM deletion_requests");
616
-        list($NumDeleteRequests) = G::$DB->next_record();
617
-        G::$Cache->cache_value('num_deletion_requests', $NumDeleteRequests);
618
-    }
619
-
620
-    if ($NumDeleteRequests > 0) {
621
-        $ModBar[] = '<a href="tools.php?action=expunge_requests">' . $NumDeleteRequests . " Expunge request".($NumDeleteRequests > 1 ? 's' : '')."</a>";
622
-    }
623
-}
624
-
625 611
 if (check_perms('users_mod') && FEATURE_EMAIL_REENABLE) {
626 612
     $NumEnableRequests = G::$Cache->get_value(AutoEnable::CACHE_KEY_NAME);
627 613
     if ($NumEnableRequests === false) {
@@ -638,7 +624,7 @@ if (check_perms('users_mod') && FEATURE_EMAIL_REENABLE) {
638 624
 if (!empty($Alerts) || !empty($ModBar)) { ?>
639 625
     <div id="alerts">
640 626
       <?php foreach ($Alerts as $Alert) { ?>
641
-      <div class="alertbar">
627
+      <div class="alertbar warning">
642 628
         <?=$Alert?>
643 629
       </div>
644 630
       <?php

+ 2
- 2
design/publicfooter.php View File

@@ -7,10 +7,10 @@ echo <<<HTML
7 7
 </main>
8 8
 
9 9
 <footer>
10
-  <a href="https://github.com/biotorrents/gazelle" target="_blank">GitHub</a>
11
-  <a href="https://docs.biotorrents.de" target="_blank">API</a>
12 10
   <a href="/legal.php?p=privacy">Privacy</a>
13 11
   <a href="/legal.php?p=dmca">DMCA</a>
12
+  <a class="external" href="https://github.com/biotorrents" target="_blank">GitHub</a>
13
+  <a class="external" href="https://patreon.com/biotorrents" target="_blank">Patreon</a>
14 14
 </footer>
15 15
 
16 16
 <script src="$ENV->STATIC_SERVER/functions/vendor/instantpage.js" type="module"></script>

+ 2
- 8
design/publicheader.php View File

@@ -68,15 +68,9 @@ if ($ENV->OPEN_REGISTRATION) {
68 68
     echo '<a href="register.php">Register</a>';
69 69
 }
70 70
 
71
-/*
72
-$Email = $ENV->HELP->Email;
73
-$Subject = $ENV->HELP->Subject;
74
-$Body = $ENV->HELP->Body;
75
-echo "<a href='mailto:$Email?subject=$Subject&body=$Body'>Support</a>";
76
-*/
77
-
78 71
 echo <<<HTML
79
-    <a href="https://github.com/biotorrents/gazelle/issues" target="_blank">Support</a>
72
+    <a href="/legal.php?p=about">About</a>
73
+    <a class="external" href="https://docs.torrents.bio" target="_blank">Docs</a>
80 74
   </header>
81 75
 
82 76
 <main>

+ 0
- 10
gazelle.sql View File

@@ -290,17 +290,6 @@ CREATE TABLE `cover_art` (
290 290
 ) ENGINE=InnoDB CHARSET=utf8mb4;
291 291
 
292 292
 
293
-CREATE TABLE `deletion_requests` (
294
-  `UserID` int unsigned NOT NULL,
295
-  `Value` varchar(255) NOT NULL,
296
-  `Type` varchar(255) NOT NULL,
297
-  `Reason` text,
298
-  `Time` datetime,
299
-  PRIMARY KEY (`UserID`,`Value`)
300
-) ENGINE=InnoDB CHARSET=utf8mb4;
301
-
302
-
303 293
 -- 2020-03-09
304 294
 CREATE TABLE `donations` (
305 295
   `UserID` int NOT NULL,

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

@@ -467,7 +467,7 @@ $TorrentDisplayList = ob_get_clean();
467 467
 // Comments (must be loaded before View::show_header so that subscriptions and quote notifications are handled properly)
468 468
 list($NumComments, $Page, $Thread, $LastRead) = Comments::load('artist', $ArtistID);
469 469
 
470
-View::show_header($Name, 'browse,requests,bbcode,comments,recommend,subscriptions');
470
+View::show_header($Name, 'browse,requests,comments,recommend,subscriptions');
471 471
 ?>
472 472
 <div>
473 473
   <div class="header">

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

@@ -29,7 +29,7 @@ list($Name) = $DB->next_record();
29 29
 // Start printing
30 30
 View::show_header(
31 31
     "Comments for collage $Name",
32
-    'comments,bbcode,subscriptions,vendor/easymde.min',
32
+    'comments,subscriptions,vendor/easymde.min',
33 33
     'vendor/easymde.min'
34 34
 );
35 35
 ?>

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

@@ -86,7 +86,7 @@ for ($i = 0; $i < $NumGroups / $CollageCovers; $i++) {
86 86
     $CollagePages[] = $CollagePage;
87 87
 }
88 88
 
89
-View::show_header($Name, 'browse,collage,bbcode,recommend');
89
+View::show_header($Name, 'browse,collage,recommend');
90 90
 ?>
91 91
 
92 92
 <div>

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

@@ -21,7 +21,7 @@ if ($CategoryID == 0 && $UserID != $LoggedUser['ID'] && !check_perms('site_colla
21 21
 
22 22
 View::show_header(
23 23
     'Edit',
24
-    'bbcode,vendor/easymde.min',
24
+    'vendor/easymde.min',
25 25
     'vendor/easymde.min'
26 26
 );
27 27
 

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

@@ -3,7 +3,7 @@
3 3
 
4 4
 View::show_header(
5 5
     'Create a collection',
6
-    'bbcode,vendor/easymde.min',
6
+    'vendor/easymde.min',
7 7
     'vendor/easymde.min'
8 8
 );
9 9
 

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

@@ -340,7 +340,7 @@ if ($CollageCovers) {
340 340
 
341 341
 View::show_header(
342 342
     $Name,
343
-    'browse,collage,bbcode,recommend,wall'
343
+    'browse,collage,recommend,wall'
344 344
 );
345 345
 ?>
346 346
 

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

@@ -275,7 +275,7 @@ switch ($Action) {
275 275
 }
276 276
 $Links = implode(' ', $ActionLinks) . (count($TypeLinks) ? '<br />' . implode(' ', $TypeLinks) : '');
277 277
 
278
-View::show_header($Title, 'bbcode,comments');
278
+View::show_header($Title, 'comments');
279 279
 ?><div>
280 280
   <div class="header">
281 281
     <h2><?=$Header?></h2>

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

@@ -28,7 +28,7 @@ if (!Forums::check_forumperm($ForumID, 'Write') || !Forums::check_forumperm($For
28 28
 $ENV = ENV::go();
29 29
 View::show_header(
30 30
     "Forums $ENV->CRUMB ".$Forum['Name']." $ENV->CRUMB New Topic",
31
-    'comments,bbcode,vendor/jquery.validate.min,form_validate,vendor/easymde.min',
31
+    'comments,vendor/jquery.validate.min,form_validate,vendor/easymde.min',
32 32
     'vendor/easymde.min'
33 33
 );
34 34
 ?>

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

@@ -88,7 +88,7 @@ if (!empty($_GET['threadid']) && is_number($_GET['threadid'])) {
88 88
 }
89 89
 
90 90
 // Let's hope we got some results - start printing out the content
91
-View::show_header('Forums &gt; Search', 'bbcode,forum_search');
91
+View::show_header('Forums &gt; Search', 'forum_search');
92 92
 ?>
93 93
 
94 94
 <div class="header">

+ 4
- 4
sections/forums/take_warn.php View File

@@ -35,7 +35,7 @@ if ($WarningLength !== 'verbal') {
35 35
   Tools::update_user_notes($UserID, $AdminComment);
36 36
 }
37 37
 
38
-$DB->query("
38
+$DB->prepared_query("
39 39
   INSERT INTO users_warnings_forums
40 40
     (UserID, Comment)
41 41
   VALUES
@@ -45,7 +45,7 @@ $DB->query("
45 45
 Misc::send_pm($UserID, $LoggedUser['ID'], $Subject, $PrivateMessage);
46 46
 
47 47
 //edit the post
48
-$DB->query("
48
+$DB->prepared_query("
49 49
   SELECT
50 50
     p.Body,
51 51
     p.AuthorID,
@@ -66,7 +66,7 @@ $DB->query("
66 66
 list($OldBody, $AuthorID, $TopicID, $ForumID, $Page) = $DB->next_record();
67 67
 
68 68
 // Perform the update
69
-$DB->query("
69
+$DB->prepared_query("
70 70
   UPDATE forums_posts
71 71
   SET Body = '" . db_string($Body) . "',
72 72
     EditedUserID = '$UserID',
@@ -101,7 +101,7 @@ if ($ThreadInfo['StickyPostID'] == $PostID) {
101 101
   $Cache->cache_value("thread_$TopicID" . '_info', $ThreadInfo, 0);
102 102
 }
103 103
 
104
-$DB->query("
104
+$DB->prepared_query("
105 105
   INSERT INTO comments_edits
106 106
     (Page, PostID, EditUser, EditTime, Body)
107 107
   VALUES

+ 12
- 12
sections/forums/thread.php View File

@@ -22,7 +22,7 @@ if (!isset($_GET['threadid']) || !is_number($_GET['threadid'])) {
22 22
     if (isset($_GET['topicid']) && is_number($_GET['topicid'])) {
23 23
         $ThreadID = $_GET['topicid'];
24 24
     } elseif (isset($_GET['postid']) && is_number($_GET['postid'])) {
25
-        $DB->query("
25
+        $DB->prepared_query("
26 26
       SELECT TopicID
27 27
       FROM forums_posts
28 28
       WHERE ID = $_GET[postid]");
@@ -78,7 +78,7 @@ if ($ThreadInfo['Posts'] > $PerPage) {
78 78
         if ($ThreadInfo['StickyPostID'] < $_GET['postid']) {
79 79
             $SQL .= " AND ID != $ThreadInfo[StickyPostID]";
80 80
         }
81
-        $DB->query($SQL);
81
+        $DB->prepared_query($SQL);
82 82
         list($PostNum) = $DB->next_record();
83 83
     } else {
84 84
         $PostNum = 1;
@@ -94,7 +94,7 @@ list($CatalogueID, $CatalogueLimit) = Format::catalogue_limit($Page, $PerPage, T
94 94
 
95 95
 // Cache catalogue from which the page is selected, allows block caches and future ability to specify posts per page
96 96
 if (!$Catalogue = $Cache->get_value("thread_{$ThreadID}_catalogue_$CatalogueID")) {
97
-    $DB->query("
97
+    $DB->prepared_query("
98 98
     SELECT
99 99
       p.ID,
100 100
       p.AuthorID,
@@ -127,14 +127,14 @@ if ($ThreadInfo['Posts'] <= $PerPage*$Page && $ThreadInfo['StickyPostID'] > $Las
127 127
 //Why would we skip this on locked or stickied threads?
128 128
 //if (!$ThreadInfo['IsLocked'] || $ThreadInfo['IsSticky']) {
129 129
 
130
-  $DB->query("
130
+  $DB->prepared_query("
131 131
     SELECT PostID
132 132
     FROM forums_last_read_topics
133 133
     WHERE UserID = '$LoggedUser[ID]'
134 134
       AND TopicID = '$ThreadID'");
135 135
   list($LastRead) = $DB->next_record();
136 136
   if ($LastRead < $LastPost) {
137
-      $DB->query("
137
+      $DB->prepared_query("
138 138
       INSERT INTO forums_last_read_topics
139 139
         (UserID, TopicID, PostID)
140 140
       VALUES
@@ -158,7 +158,7 @@ if (in_array($ThreadID, $UserSubscriptions)) {
158 158
 
159 159
 $QuoteNotificationsCount = $Cache->get_value('notify_quoted_' . $LoggedUser['ID']);
160 160
 if ($QuoteNotificationsCount === false || $QuoteNotificationsCount > 0) {
161
-    $DB->query("
161
+    $DB->prepared_query("
162 162
     UPDATE users_notify_quoted
163 163
     SET UnRead = false
164 164
     WHERE UserID = '$LoggedUser[ID]'
@@ -172,7 +172,7 @@ if ($QuoteNotificationsCount === false || $QuoteNotificationsCount > 0) {
172 172
 // Start printing
173 173
 View::show_header(
174 174
     $ThreadInfo['Title'].' &rsaquo; '.$Forums[$ForumID]['Name'].' &rsaquo; Forums',
175
-    'comments,subscriptions,bbcode,vendor/easymde.min',
175
+    'comments,subscriptions,vendor/easymde.min',
176 176
     ($IsDonorForum ?? 'donor,').'vendor/easymde.min'
177 177
 );
178 178
 ?>
@@ -243,13 +243,13 @@ echo $Pages;
243 243
 
244 244
 if ($ThreadInfo['NoPoll'] == 0) {
245 245
     if (!list($Question, $Answers, $Votes, $Featured, $Closed) = $Cache->get_value("polls_$ThreadID")) {
246
-        $DB->query("
246
+        $DB->prepared_query("
247 247
       SELECT Question, Answers, Featured, Closed
248 248
       FROM forums_polls
249 249
       WHERE TopicID = '$ThreadID'");
250 250
         list($Question, $Answers, $Featured, $Closed) = $DB->next_record(MYSQLI_NUM, array(1));
251 251
         $Answers = unserialize($Answers);
252
-        $DB->query("
252
+        $DB->prepared_query("
253 253
       SELECT Vote, COUNT(UserID)
254 254
       FROM forums_polls_votes
255 255
       WHERE TopicID = '$ThreadID'
@@ -281,7 +281,7 @@ if ($ThreadInfo['NoPoll'] == 0) {
281 281
     #$RevealVoters = in_array($ForumID, FORUMS_TO_REVEAL_VOTERS);
282 282
 
283 283
     // Polls lose the you voted arrow thingy
284
-    $DB->query("
284
+    $DB->prepared_query("
285 285
     SELECT Vote
286 286
     FROM forums_polls_votes
287 287
     WHERE UserID = '".$LoggedUser['ID']."'
@@ -349,7 +349,7 @@ if ($ThreadInfo['NoPoll'] == 0) {
349 349
             $StaffNames[] = $Staffer['Username'];
350 350
         }
351 351
 
352
-        $DB->query("
352
+        $DB->prepared_query("
353 353
         SELECT
354 354
           fpv.Vote AS Vote,
355 355
           GROUP_CONCAT(um.Username SEPARATOR ', ')
@@ -636,7 +636,7 @@ if (!$ThreadInfo['IsLocked'] || check_perms('site_moderate_forums')) {
636 636
   }
637 637
 
638 638
 if (check_perms('site_moderate_forums')) {
639
-    G::$DB->query("
639
+    G::$DB->prepared_query("
640 640
       SELECT ID, AuthorID, AddedTime, Body
641 641
       FROM forums_topic_notes
642 642
       WHERE TopicID = $ThreadID

+ 3
- 3
sections/forums/warn.php View File

@@ -11,14 +11,14 @@ $UserID = (int) $_POST['userid'];
11 11
 $Key = (int) $_POST['key'];
12 12
 $UserInfo = Users::user_info($UserID);
13 13
 
14
-$DB->query("
14
+$DB->prepared_query("
15 15
   SELECT p.Body, t.ForumID
16 16
   FROM forums_posts AS p
17 17
     JOIN forums_topics AS t ON p.TopicID = t.ID
18 18
   WHERE p.ID = '$PostID'");
19 19
 list($PostBody, $ForumID) = $DB -> next_record();
20 20
 
21
-View::show_header('Warn User');
21
+View::show_header('Warn');
22 22
 ?>
23 23
 
24 24
 <div>
@@ -75,7 +75,7 @@ View::show_header('Warn User');
75 75
             <textarea id="body" style="width: 95%;" tabindex="1" onkeyup="resize('body');" name="body" cols="90"
76 76
               rows="8"><?=$PostBody?></textarea>
77 77
             <br />
78
-            <input type="submit" id="submit_button" value="Warn user" tabindex="1" />
78
+            <input type="submit" id="submit_button" class="button-primary" value="Warn user" tabindex="1" />
79 79
           </td>
80 80
         </tr>
81 81
       </table>

+ 17
- 13
sections/friends/add.php View File

@@ -1,23 +1,27 @@
1 1
 <?php
2
+declare(strict_types = 1);
3
+
2 4
 authorize();
3
-if (!is_number($_GET['friendid'])) {
4
-  error(404);
5
-}
6
-$FriendID = db_string($_GET['friendid']);
5
+
6
+$FriendID = (int) $_GET['friendid'];
7
+Security::checkInt($FriendID);
7 8
 
8 9
 // Check if the user $FriendID exists
9
-$DB->query("
10
-  SELECT 1
11
-  FROM users_main
12
-  WHERE ID = '$FriendID'");
10
+$DB->prepared_query("
11
+SELECT 1
12
+FROM `users_main`
13
+WHERE `ID` = '$FriendID'
14
+");
15
+
13 16
 if (!$DB->has_results()) {
14
-  error(404);
17
+    error(404);
15 18
 }
16 19
 
17
-$DB->query("
18
-  INSERT IGNORE INTO friends
19
-    (UserID, FriendID)
20
+$DB->prepared_query("
21
+  INSERT IGNORE INTO `friends`
22
+    (`UserID`, `FriendID`)
20 23
   VALUES
21
-    ('$LoggedUser[ID]', '$FriendID')");
24
+    ('$LoggedUser[ID]', '$FriendID')
25
+");
22 26
 
23 27
 header('Location: friends.php');

+ 9
- 7
sections/friends/comment.php View File

@@ -1,9 +1,11 @@
1
-<?
2
-$DB->query("
3
-  UPDATE friends
4
-  SET Comment='$P[comment]'
5
-  WHERE UserID='$LoggedUser[ID]'
6
-    AND FriendID='$P[friendid]'");
1
+<?php
2
+declare(strict_types = 1);
3
+
4
+$DB->prepared_query("
5
+  UPDATE `friends`
6
+  SET `Comment`='$P[comment]'
7
+  WHERE `UserID`='$LoggedUser[ID]'
8
+    AND `FriendID`='$P[friendid]'
9
+");
7 10
 
8 11
 header('Location: friends.php');
9
-?>

+ 4
- 4
sections/friends/friends.php View File

@@ -3,7 +3,7 @@
3 3
 
4 4
 /**
5 5
  * Main friends page
6
- * 
6
+ *
7 7
  * This page lists a user's friends.
8 8
  * There's no real point in caching this page.
9 9
  * I doubt users load it that much.
@@ -21,7 +21,7 @@ $UserID = $LoggedUser['ID'];
21 21
 list($Page, $Limit) = Format::page_limit(FRIENDS_PER_PAGE);
22 22
 
23 23
 // Main query
24
-$DB->query("
24
+$DB->prepared_query("
25 25
   SELECT
26 26
     SQL_CALC_FOUND_ROWS
27 27
     f.`FriendID`,
@@ -42,10 +42,10 @@ $DB->query("
42 42
 $Friends = $DB->to_array(false, MYSQLI_BOTH, array(6, 'Paranoia'));
43 43
 
44 44
 // Number of results (for pagination)
45
-$DB->query('SELECT FOUND_ROWS()');
45
+$DB->prepared_query('SELECT FOUND_ROWS()');
46 46
 list($Results) = $DB->next_record();
47 47
 
48
-// Start printing stuff ?>
48
+// Start printing stuff?>
49 49
 
50 50
 <div>
51 51
   <div class="header">

+ 17
- 15
sections/friends/index.php View File

@@ -1,33 +1,35 @@
1
-<?
2
-$P = db_array($_POST);
1
+<?php
2
+declare(strict_types = 1);
3
+
3 4
 enforce_login();
4
-if (!empty($_REQUEST['friendid']) && !is_number($_REQUEST['friendid'])) {
5
-  error(404);
6
-}
5
+$P = db_array($_POST);
6
+
7
+$FriendID = (int) $_REQUEST['friendid'];
8
+Security::checkInt($FriendID);
7 9
 
8 10
 if (!empty($_REQUEST['action'])) {
9
-  switch ($_REQUEST['action']) {
11
+    switch ($_REQUEST['action']) {
10 12
     case 'add':
11
-      include(SERVER_ROOT.'/sections/friends/add.php');
13
+      require_once "$ENV->SERVER_ROOT/sections/friends/add.php";
12 14
       break;
15
+
13 16
     case 'Remove friend':
14 17
       authorize();
15
-      include(SERVER_ROOT.'/sections/friends/remove.php');
18
+      require_once "$ENV->SERVER_ROOT/sections/friends/remove.php";
16 19
       break;
20
+
17 21
     case 'Update':
18 22
       authorize();
19
-      include(SERVER_ROOT.'/sections/friends/comment.php');
20
-      break;
21
-    case 'whois':
22
-      include(SERVER_ROOT.'/sections/friends/whois.php');
23
+      require_once "$ENV->SERVER_ROOT/sections/friends/comment.php";
23 24
       break;
25
+
24 26
     case 'Contact':
25
-      header('Location: inbox.php?action=compose&to='.$_POST['friendid']);
27
+      header("Location: inbox.php?action=compose&to=$FriendID");
26 28
       break;
29
+      
27 30
     default:
28 31
       error(404);
29 32
   }
30 33
 } else {
31
-  include(SERVER_ROOT.'/sections/friends/friends.php');
34
+    require_once "$ENV->SERVER_ROOT/sections/friends/friends.php";
32 35
 }
33
-?>

+ 8
- 6
sections/friends/remove.php View File

@@ -1,8 +1,10 @@
1
-<?
2
-$DB->query("
3
-  DELETE FROM friends
4
-  WHERE UserID='$LoggedUser[ID]'
5
-    AND FriendID='$P[friendid]'");
1
+<?php
2
+declare(strict_types = 1);
3
+
4
+$DB->prepared_query("
5
+  DELETE FROM `friends`
6
+  WHERE `UserID`='$LoggedUser[ID]'
7
+    AND `FriendID`='$P[friendid]'
8
+");
6 9
 
7 10
 header('Location: friends.php');
8
-?>

+ 3
- 3
sections/inbox/compose.php View File

@@ -19,7 +19,7 @@ if (!empty($LoggedUser['DisablePM']) && !isset($StaffIDs[$ToID])) {
19 19
     error(403);
20 20
 }
21 21
 
22
-$DB->query("
22
+$DB->prepared_query("
23 23
   SELECT Username
24 24
   FROM users_main
25 25
   WHERE ID='$ToID'");
@@ -29,7 +29,7 @@ if (!$Username) {
29 29
 }
30 30
 View::show_header(
31 31
     'Compose',
32
-    'inbox,bbcode,vendor/jquery.validate.min,form_validate,vendor/easymde.min',
32
+    'inbox,vendor/jquery.validate.min,form_validate,vendor/easymde.min',
33 33
     'vendor/easymde.min'
34 34
 );
35 35
 ?>
@@ -60,7 +60,7 @@ new TEXTAREA_PREVIEW(
60 60
       <div id="preview" class="hidden"></div>
61 61
       <div id="buttons" class="center">
62 62
         <input type="button" value="Preview" onclick="Quick_Preview();" />
63
-        <input type="submit" value="Send message" />
63
+        <input type="submit" class="button-primary" value="Send message" />
64 64
       </div>
65 65
     </div>
66 66
   </form>

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

@@ -63,7 +63,7 @@ if ($UnRead == '1') {
63 63
 
64 64
 View::show_header(
65 65
     "View conversation $Subject",
66
-    'comments,inbox,bbcode,vendor/jquery.validate.min,form_validate,vendor/easymde.min',
66
+    'comments,inbox,vendor/jquery.validate.min,form_validate,vendor/easymde.min',
67 67
     'vendor/easymde.min'
68 68
 );
69 69
 

+ 6
- 0
sections/legal/index.php View File

@@ -5,6 +5,12 @@ $Twig = Twig::go();
5 5
 $p = $_GET['p'];
6 6
 
7 7
 switch ($p) {
8
+    case 'about':
9
+        View::show_header('About');
10
+        echo $Twig->render('legal/about.html');
11
+        View::show_footer();
12
+        break;
13
+
8 14
     case 'privacy':
9 15
         View::show_header('Privacy');
10 16
         echo $Twig->render('legal/privacy.html');

+ 1
- 1
sections/reports/compose.php View File

@@ -35,7 +35,7 @@ list($ComposeToUsername) = $DB->next_record();
35 35
 if (!$ComposeToUsername) {
36 36
   error(404);
37 37
 }
38
-View::show_header('Compose', 'inbox,bbcode');
38
+View::show_header('Compose', 'inbox');
39 39
 
40 40
 // $TypeLink is placed directly in the <textarea> when composing a PM
41 41
 switch ($Type) {

+ 1
- 1
sections/reports/report.php View File

@@ -128,7 +128,7 @@ switch ($Short) {
128 128
 
129 129
 View::show_header(
130 130
     'Report a '.$Type['title'],
131
-    'bbcode,vendor/jquery.validate.min,form_validate'
131
+    'vendor/jquery.validate.min,form_validate'
132 132
 );
133 133
 ?>
134 134
 <div class="thin">

+ 1
- 1
sections/reports/reports.php View File

@@ -13,7 +13,7 @@ list($Page, $Limit) = Format::page_limit(REPORTS_PER_PAGE);
13 13
 include(SERVER_ROOT . '/sections/reports/array.php');
14 14
 
15 15
 // Header
16
-View::show_header('Reports', 'bbcode,reports');
16
+View::show_header('Reports', 'reports');
17 17
 
18 18
 if (isset($_GET['id']) && $_GET['id'] && is_number($_GET['id'])) {
19 19
   $View = 'Single report';

+ 3
- 3
sections/reportsv2/ajax_create_report.php View File

@@ -23,7 +23,7 @@ if (!is_number($_POST['torrentid'])) {
23 23
   $TorrentID = $_POST['torrentid'];
24 24
 }
25 25
 
26
-$DB->query("
26
+$DB->prepared_query("
27 27
   SELECT tg.CategoryID
28 28
   FROM torrents_group AS tg
29 29
     JOIN torrents AS t ON t.GroupID = tg.ID
@@ -63,7 +63,7 @@ if (!empty($Err)) {
63 63
   error();
64 64
 }
65 65
 
66
-$DB->query("
66
+$DB->prepared_query("
67 67
   SELECT ID
68 68
   FROM reportsv2
69 69
   WHERE TorrentID = $TorrentID
@@ -73,7 +73,7 @@ if ($DB->has_results()) {
73 73
   error();
74 74
 }
75 75
 
76
-$DB->query("
76
+$DB->prepared_query("
77 77
   INSERT INTO reportsv2
78 78
     (ReporterID, TorrentID, Type, UserComment, Status, ReportedTime, ExtraID)
79 79
   VALUES

+ 2
- 2
sections/reportsv2/ajax_giveback_report.php View File

@@ -7,13 +7,13 @@ if (!is_number($_GET['id'])) {
7 7
   error();
8 8
 }
9 9
 
10
-$DB->query("
10
+$DB->prepared_query("
11 11
   SELECT Status
12 12
   FROM reportsv2
13 13
   WHERE ID = ".$_GET['id']);
14 14
 list($Status) = $DB->next_record();
15 15
 if (isset($Status)) {
16
-  $DB->query("
16
+  $DB->prepared_query("
17 17
     UPDATE reportsv2
18 18
     SET Status = 'New', ResolverID = 0
19 19
     WHERE ID = ".$_GET['id']);

+ 1
- 1
sections/reportsv2/ajax_grab_report.php View File

@@ -13,7 +13,7 @@ if (!is_number($_GET['id'])) {
13 13
   error();
14 14
 }
15 15
 
16
-$DB->query("
16
+$DB->prepared_query("
17 17
   UPDATE reportsv2
18 18
   SET Status = 'InProgress',
19 19
     ResolverID = " . $LoggedUser['ID'] . "

+ 7
- 7
sections/reportsv2/ajax_new_report.php View File

@@ -10,7 +10,7 @@ if (!check_perms('admin_reports')) {
10 10
 }
11 11
 
12 12
 
13
-$DB->query("
13
+$DB->prepared_query("
14 14
   SELECT
15 15
     r.ID,
16 16
     r.ReporterID,
@@ -79,7 +79,7 @@ $DB->query("
79 79
 
80 80
     if (!$GroupID) {
81 81
       //Torrent already deleted
82
-      $DB->query("
82
+      $DB->prepared_query("
83 83
         UPDATE reportsv2
84 84
         SET
85 85
           Status = 'Resolved',
@@ -94,7 +94,7 @@ $DB->query("
94 94
 <?
95 95
       error();
96 96
     }
97
-    $DB->query("
97
+    $DB->prepared_query("
98 98
       UPDATE reportsv2
99 99
       SET Status = 'InProgress',
100 100
         ResolverID = ".$LoggedUser['ID']."
@@ -155,7 +155,7 @@ $DB->query("
155 155
               uploaded by <a href="user.php?id=<?=$UploaderID?>"><?=$UploaderName?></a> <?=time_diff($Time)?>
156 156
               <br />
157 157
               <div style="text-align: right;">was reported by <a href="user.php?id=<?=$ReporterID?>"><?=$ReporterName?></a> <?=time_diff($ReportedTime)?> for the reason: <strong><?=$ReportType['title']?></strong></div>
158
-<?php $DB->query("
158
+<?php $DB->prepared_query("
159 159
             SELECT r.ID
160 160
             FROM reportsv2 AS r
161 161
               LEFT JOIN torrents AS t ON t.ID = r.TorrentID
@@ -167,7 +167,7 @@ $DB->query("
167 167
               <div style="text-align: right;">
168 168
                 <a href="reportsv2.php?view=group&amp;id=<?=$GroupID?>">There <?=(($GroupOthers > 1) ? "are $GroupOthers other reports" : "is 1 other report")?> for torrents in this group</a>
169 169
               </div>
170
-<?php $DB->query("
170
+<?php $DB->prepared_query("
171 171
             SELECT t.UserID
172 172
             FROM reportsv2 AS r
173 173
               JOIN torrents AS t ON t.ID = r.TorrentID
@@ -181,7 +181,7 @@ $DB->query("
181 181
               </div>
182 182
 <?php }
183 183
 
184
-        $DB->query("
184
+        $DB->prepared_query("
185 185
             SELECT DISTINCT req.ID,
186 186
               req.FillerID,
187 187
               um.Username,
@@ -242,7 +242,7 @@ $DB->query("
242 242
         $First = true;
243 243
         $Extras = explode(' ', $ExtraIDs);
244 244
         foreach ($Extras as $ExtraID) {
245
-            $DB->query("
245
+            $DB->prepared_query("
246 246
                 SELECT
247 247
                   tg.Name,
248 248
                   tg.ID,

+ 2
- 2
sections/reportsv2/ajax_update_comment.php View File

@@ -12,13 +12,13 @@ $ReportID = (int) $_POST['reportid'];
12 12
 $Message = db_string($_POST['comment']);
13 13
 //Message can be blank!
14 14
 
15
-$DB->query("
15
+$DB->prepared_query("
16 16
   SELECT ModComment
17 17
   FROM reportsv2
18 18
   WHERE ID = $ReportID");
19 19
 list($ModComment) = $DB->next_record();
20 20
 if (isset($ModComment)) {
21
-  $DB->query("
21
+  $DB->prepared_query("
22 22
     UPDATE reportsv2
23 23
     SET ModComment = '$Message'
24 24
     WHERE ID = $ReportID");

+ 1
- 1
sections/reportsv2/ajax_update_resolve.php View File

@@ -30,7 +30,7 @@ if (!array_key_exists($NewType, $TypeList)) {
30 30
   error();
31 31
 }
32 32
 
33
-$DB->query("
33
+$DB->prepared_query("
34 34
   UPDATE reportsv2
35 35
   SET Type = '$NewType'
36 36
   WHERE ID = $ReportID");

+ 2
- 2
sections/reportsv2/report.php View File

@@ -17,7 +17,7 @@ if (!isset($_GET['id']) || !is_number($_GET['id'])) {
17 17
     }
18 18
 } else {
19 19
     $TorrentID = $_GET['id'];
20
-    $DB->query("
20
+    $DB->prepared_query("
21 21
     SELECT tg.`category_id`, t.`GroupID`, u.`Username`
22 22
     FROM `torrents_group` AS tg
23 23
       LEFT JOIN `torrents` AS t ON t.`GroupID` = tg.`id`
@@ -67,7 +67,7 @@ if (!isset($_GET['id']) || !is_number($_GET['id'])) {
67 67
     */
68 68
 }
69 69
 
70
-View::show_header('Report', 'reportsv2,browse,torrent,bbcode,recommend');
70
+View::show_header('Report', 'reportsv2,browse,torrent,recommend');
71 71
 ?>
72 72
 
73 73
 <div>

+ 12
- 12
sections/reportsv2/static.php View File

@@ -62,7 +62,7 @@ if (!$ID) {
62 62
 } else {
63 63
     switch ($View) {
64 64
     case 'staff':
65
-      $DB->query("
65
+      $DB->prepared_query("
66 66
         SELECT `Username`
67 67
         FROM `users_main`
68 68
         WHERE `ID` = $ID");
@@ -78,7 +78,7 @@ if (!$ID) {
78 78
       break;
79 79
 
80 80
     case 'resolver':
81
-      $DB->query("
81
+      $DB->prepared_query("
82 82
         SELECT `Username`
83 83
         FROM `users_main`
84 84
         WHERE `ID` = $ID");
@@ -112,7 +112,7 @@ if (!$ID) {
112 112
       break;
113 113
 
114 114
     case 'reporter':
115
-      $DB->query("
115
+      $DB->prepared_query("
116 116
         SELECT `Username`
117 117
         FROM `users_main`
118 118
         WHERE `ID` = $ID");
@@ -127,7 +127,7 @@ if (!$ID) {
127 127
       break;
128 128
 
129 129
     case 'uploader':
130
-      $DB->query("
130
+      $DB->prepared_query("
131 131
         SELECT `Username`
132 132
         FROM `users_main`
133 133
         WHERE `ID` = $ID");
@@ -158,7 +158,7 @@ if (!$ID) {
158 158
 /**
159 159
  * The large query
160 160
  */
161
-$DB->query("
161
+$DB->prepared_query("
162 162
   SELECT
163 163
     SQL_CALC_FOUND_ROWS
164 164
     r.`ID`,
@@ -211,11 +211,11 @@ $DB->query("
211 211
 
212 212
 $Reports = $DB->to_array();
213 213
 
214
-$DB->query('SELECT FOUND_ROWS()');
214
+$DB->prepared_query('SELECT FOUND_ROWS()');
215 215
 list($Results) = $DB->next_record();
216 216
 $PageLinks = Format::get_pages($Page, $Results, REPORTS_PER_PAGE, 11);
217 217
 
218
-View::show_header('Reports V2!', 'reportsv2,bbcode');
218
+View::show_header('Reports V2!', 'reportsv2');
219 219
 ?>
220 220
 <div class="header">
221 221
   <h2><?=$Title?></h2>
@@ -253,7 +253,7 @@ if (count($Reports) === 0) {
253 253
 
254 254
           if (!$GroupID && $Status != 'Resolved') {
255 255
               //Torrent already deleted
256
-              $DB->query("
256
+              $DB->prepared_query("
257 257
         UPDATE `reportsv2`
258 258
         SET
259 259
           `Status` = 'Resolved',
@@ -338,7 +338,7 @@ if (count($Reports) === 0) {
338 338
 } ?>
339 339
             <div style="text-align: right;">was reported by <a href="user.php?id=<?=$ReporterID?>"><?=$ReporterName?></a> <?=time_diff($ReportedTime)?> for the reason: <strong><?=$ReportType['title']?></strong></div>
340 340
 <?php if ($Status != 'Resolved') {
341
-    $DB->query("
341
+    $DB->prepared_query("
342 342
             SELECT r.`ID`
343 343
             FROM `reportsv2` AS r
344 344
               LEFT JOIN `torrents` AS t ON t.`ID` = r.`TorrentID`
@@ -352,7 +352,7 @@ if (count($Reports) === 0) {
352 352
             </div>
353 353
 <?php }
354 354
 
355
-    $DB->query("
355
+    $DB->prepared_query("
356 356
             SELECT t.`UserID`
357 357
             FROM `reportsv2` AS r
358 358
               JOIN `torrents` AS t ON t.`ID` = r.`TorrentID`
@@ -366,7 +366,7 @@ if (count($Reports) === 0) {
366 366
             </div>
367 367
 <?php }
368 368
 
369
-    $DB->query("
369
+    $DB->prepared_query("
370 370
             SELECT DISTINCT req.`ID`,
371 371
               req.`FillerID`,
372 372
               um.`Username`,
@@ -428,7 +428,7 @@ if (count($Reports) === 0) {
428 428
         $First = true;
429 429
         $Extras = explode(' ', $ExtraIDs);
430 430
         foreach ($Extras as $ExtraID) {
431
-            $DB->query("
431
+            $DB->prepared_query("
432 432
             SELECT
433 433
               COALESCE(NULLIF(tg.`title`, ''), NULLIF(tg.`subject`, ''), tg.`object`) AS Name,
434 434
               tg.`id`,

+ 74
- 82
sections/reportsv2/takereport.php View File

@@ -1,4 +1,4 @@
1
-<?
1
+<?php
2 2
 
3 3
 /**
4 4
  * This page handles the backend from when a user submits a report.
@@ -14,139 +14,131 @@
14 14
 
15 15
 authorize();
16 16
 
17
-if (!is_number($_POST['torrentid'])) {
18
-  error(404);
19
-} else {
20
-  $TorrentID = $_POST['torrentid'];
21
-}
22
-
23
-if (!is_number($_POST['categoryid'])) {
24
-  error(404);
25
-} else {
26
-  $CategoryID = $_POST['categoryid'];
27
-}
17
+$TorrentID = (int) $_POST['torrentid'];
18
+$CategoryID = (int) $_POST['categoryid'];
19
+Security::checkInt($TorrentID, $CategoryID);
28 20
 
29 21
 if (!isset($_POST['type'])) {
30
-  error(404);
22
+    error(404);
31 23
 } elseif (array_key_exists($_POST['type'], $Types[$CategoryID])) {
32
-  $Type = $_POST['type'];
33
-  $ReportType = $Types[$CategoryID][$Type];
24
+    $Type = $_POST['type'];
25
+    $ReportType = $Types[$CategoryID][$Type];
34 26
 } elseif (array_key_exists($_POST['type'], $Types['master'])) {
35
-  $Type = $_POST['type'];
36
-  $ReportType = $Types['master'][$Type];
27
+    $Type = $_POST['type'];
28
+    $ReportType = $Types['master'][$Type];
37 29
 } else {
38
-  //There was a type but it wasn't an option!
39
-  error(403);
30
+    // There was a type but it wasn't an option!
31
+    error(403);
40 32
 }
41 33
 
42
-
43 34
 foreach ($ReportType['report_fields'] as $Field => $Value) {
44
-  if ($Value == '1') {
45
-    if (empty($_POST[$Field])) {
46
-      $Err = "You are missing a required field ($Field) for a ".$ReportType['title'].' report.';
35
+    if ($Value === '1') {
36
+        if (empty($_POST[$Field])) {
37
+            $Err = "You are missing a required field ($Field) for a ".$ReportType['title'].' report.';
38
+        }
47 39
     }
48
-  }
49 40
 }
50 41
 
51 42
 if (!empty($_POST['sitelink'])) {
52
-  if (preg_match_all('/'.TORRENT_REGEX.'/i', $_POST['sitelink'], $Matches)) {
53
-    $ExtraIDs = implode(' ', $Matches[4]);
54
-    if (in_array($TorrentID, $Matches[4])) {
55
-      $Err = "The extra permalinks you gave included the link to the torrent you're reporting!";
43
+    if (preg_match_all('/'.TORRENT_REGEX.'/i', $_POST['sitelink'], $Matches)) {
44
+        $ExtraIDs = implode(' ', $Matches[4]);
45
+
46
+        if (in_array($TorrentID, $Matches[4])) {
47
+            $Err = "The extra permalinks you gave included the link to the torrent you're reporting!";
48
+        }
49
+    } else {
50
+        $Err = 'The permalink was incorrect. It should look like '.site_url().'torrents.php?torrentid=12345';
56 51
     }
57
-  } else {
58
-    $Err = 'The permalink was incorrect. It should look like '.site_url().'torrents.php?torrentid=12345';
59
-  }
60 52
 }
61 53
 
62 54
 if (!empty($_POST['link'])) {
63
-  //resource_type://domain:port/filepathname?query_string#anchor
64
-  //          http://   www     .foo.com                /bar
65
-  if (preg_match_all('/'.URL_REGEX.'/is', $_POST['link'], $Matches)) {
66
-    $Links = implode(' ', $Matches[0]);
67
-  } else {
68
-    $Err = "The extra links you provided weren't links...";
69
-  }
55
+    // resource_type://domain:port/filepathname?query_string#anchor
56
+    if (preg_match_all('/'.URL_REGEX.'/is', $_POST['link'], $Matches)) {
57
+        $Links = implode(' ', $Matches[0]);
58
+    } else {
59
+        $Err = "The extra links you provided weren't links...";
60
+    }
70 61
 } else {
71
-  $Links = '';
62
+    $Links = '';
72 63
 }
73 64
 
74 65
 if (!empty($_POST['image'])) {
75
-  if (preg_match("/^(".IMAGE_REGEX.")( ".IMAGE_REGEX.")*$/is", trim($_POST['image']), $Matches)) {
76
-    $Images = $Matches[0];
77
-  } else {
78
-    $Err = "The extra image links you provided weren't links to images...";
79
-  }
66
+    if (preg_match("/^(".IMAGE_REGEX.")( ".IMAGE_REGEX.")*$/is", trim($_POST['image']), $Matches)) {
67
+        $Images = $Matches[0];
68
+    } else {
69
+        $Err = "The extra image links you provided weren't links to images...";
70
+    }
80 71
 } else {
81
-  $Images = '';
72
+    $Images = '';
82 73
 }
83 74
 
84 75
 if (!empty($_POST['track'])) {
85
-  if (preg_match('/([0-9]+( [0-9]+)*)|All/is', $_POST['track'], $Matches)) {
86
-    $Tracks = $Matches[0];
87
-  } else {
88
-    $Err = 'Tracks should be given in a space-separated list of numbers with no other characters.';
89
-  }
76
+    if (preg_match('/([0-9]+( [0-9]+)*)|All/is', $_POST['track'], $Matches)) {
77
+        $Tracks = $Matches[0];
78
+    } else {
79
+        $Err = 'Tracks should be given in a space-separated list of numbers with no other characters.';
80
+    }
90 81
 } else {
91
-  $Tracks = '';
82
+    $Tracks = '';
92 83
 }
93 84
 
94 85
 if (!empty($_POST['extra'])) {
95
-  $Extra = db_string($_POST['extra']);
86
+    $Extra = db_string($_POST['extra']);
96 87
 } else {
97
-  $Err = 'As useful as blank reports are, could you be a tiny bit more helpful? (Leave a comment)';
88
+    $Err = 'As useful as blank reports are, could you be a tiny bit more helpful? (Leave a comment)';
98 89
 }
99 90
 
100
-$DB->query("
101
-  SELECT GroupID
102
-  FROM torrents
103
-  WHERE ID = $TorrentID");
91
+$DB->prepared_query("
92
+  SELECT `GroupID`
93
+  FROM `torrents`
94
+  WHERE `ID` = '$TorrentID'
95
+  ");
104 96
 if (!$DB->has_results()) {
105
-  $Err = "A torrent with that ID doesn't exist!";
97
+    $Err = "A torrent with that ID doesn't exist!";
106 98
 }
107 99
 list($GroupID) = $DB->next_record();
108 100
 
109 101
 if (!empty($Err)) {
110
-  error($Error = $Err, $Debug = false);
111
-  include(SERVER_ROOT.'/sections/reportsv2/report.php');
112
-  error();
102
+    error($Error = $Err, $Debug = false);
103
+    include(SERVER_ROOT.'/sections/reportsv2/report.php');
104
+    error();
113 105
 }
114 106
 
115
-$DB->query("
116
-  SELECT ID
117
-  FROM reportsv2
118
-  WHERE TorrentID = $TorrentID
119
-    AND ReporterID = ".db_string($LoggedUser['ID'])."
120
-    AND ReportedTime > '".time_minus(3)."'");
107
+$DB->prepared_query("
108
+  SELECT `ID`
109
+  FROM `reportsv2`
110
+  WHERE `TorrentID` = '$TorrentID'
111
+    AND `ReporterID` = ".db_string($LoggedUser['ID'])."
112
+    AND `ReportedTime` > '".time_minus(3)."'");
121 113
 if ($DB->has_results()) {
122
-  header("Location: torrents.php?torrentid=$TorrentID");
123
-  error();
114
+    header("Location: torrents.php?torrentid=$TorrentID");
115
+    error();
124 116
 }
125 117
 
126
-$DB->query("
127
-  INSERT INTO reportsv2
128
-    (ReporterID, TorrentID, Type, UserComment, Status, ReportedTime, Track, Image, ExtraID, Link)
118
+$DB->prepared_query("
119
+  INSERT INTO `reportsv2`
120
+    (`ReporterID`, `TorrentID`, `Type`, `UserComment`, `Status`, `ReportedTime`, `Track`, `Image`, `ExtraID`, `Link`)
129 121
   VALUES
130 122
     (".db_string($LoggedUser['ID']).", $TorrentID, '".db_string($Type)."', '$Extra', 'New', NOW(), '".db_string($Tracks)."', '".db_string($Images)."', '".db_string($ExtraIDs)."', '".db_string($Links)."')");
131 123
 
132 124
 $ReportID = $DB->inserted_id();
133 125
 
134
-$DB->query("
135
-  SELECT UserID
136
-  FROM torrents
137
-  WHERE ID = $TorrentID");
126
+$DB->prepared_query("
127
+  SELECT `UserID`
128
+  FROM `torrents`
129
+  WHERE `ID` = $TorrentID");
138 130
 list($UploaderID) = $DB->next_record();
139
-$DB->query("
140
-  SELECT Name, Title2, NameJP
141
-  FROM torrents_group
142
-  WHERE ID = $GroupID");
131
+$DB->prepared_query("
132
+  SELECT `title`, `subject`, `object`
133
+  FROM `torrents_group`
134
+  WHERE `id` = '$GroupID'
135
+  ");
143 136
 list($GroupNameEng, $GroupTitle2, $GroupNameJP) = $DB->next_record();
144 137
 $GroupName = $GroupNameEng ? $GroupNameEng : ($GroupTitle2 ? $GroupTitle2 : $GroupNameJP);
145 138
 
146 139
 Misc::send_pm($UploaderID, 0, "Torrent Reported: $GroupName", "Your torrent, \"[url=".site_url()."torrents.php?torrentid=$TorrentID]".$GroupName."[/url]\", was reported for the reason \"".$ReportType['title']."\".\n\nThe reporter also said: \"$Extra\"\n\nIf you think this report was in error, please contact staff. Failure to challenge some types of reports in a timely manner will be regarded as a lack of defense and may result in the torrent being deleted.");
147 140
 
148 141
 $Cache->delete_value("reports_torrent_$TorrentID");
149
-
150 142
 $Cache->increment('num_torrent_reportsv2');
143
+
151 144
 header("Location: torrents.php?torrentid=$TorrentID");
152
-?>

+ 19
- 19
sections/reportsv2/takeresolve.php View File

@@ -74,7 +74,7 @@ if (($Escaped['resolve_type'] == 'manual' || $Escaped['resolve_type'] == 'dismis
74 74
     }
75 75
   }
76 76
 
77
-  $DB->query("
77
+  $DB->prepared_query("
78 78
     UPDATE reportsv2
79 79
     SET
80 80
       Status = 'Resolved',
@@ -116,13 +116,13 @@ if (!isset($Escaped['resolve_type'])) {
116 116
   error();
117 117
 }
118 118
 
119
-$DB->query("
119
+$DB->prepared_query("
120 120
   SELECT ID
121 121
   FROM torrents
122 122
   WHERE ID = $TorrentID");
123 123
 $TorrentExists = ($DB->has_results());
124 124
 if (!$TorrentExists) {
125
-  $DB->query("
125
+  $DB->prepared_query("
126 126
     UPDATE reportsv2
127 127
     SET Status = 'Resolved',
128 128
       LastChangeTime = NOW(),
@@ -135,7 +135,7 @@ if (!$TorrentExists) {
135 135
 
136 136
 if ($Report) {
137 137
   //Resolve with a parallel check
138
-  $DB->query("
138
+  $DB->prepared_query("
139 139
     UPDATE reportsv2
140 140
     SET Status = 'Resolved',
141 141
       LastChangeTime = NOW(),
@@ -159,12 +159,12 @@ if ($DB->affected_rows() > 0 || !$Report) {
159 159
   }
160 160
 
161 161
   if ($_POST['resolve_type'] == 'tags_lots') {
162
-    $DB->query("
162
+    $DB->prepared_query("
163 163
       INSERT IGNORE INTO torrents_bad_tags
164 164
         (TorrentID, UserID, TimeAdded)
165 165
       VALUES
166 166
         ($TorrentID, ".$LoggedUser['ID']." , NOW())");
167
-    $DB->query("
167
+    $DB->prepared_query("
168 168
       SELECT GroupID
169 169
       FROM torrents
170 170
       WHERE ID = $TorrentID");
@@ -174,12 +174,12 @@ if ($DB->affected_rows() > 0 || !$Report) {
174 174
   }
175 175
 
176 176
   if ($_POST['resolve_type'] == 'folders_bad') {
177
-    $DB->query("
177
+    $DB->prepared_query("
178 178
       INSERT IGNORE INTO torrents_bad_folders
179 179
         (TorrentID, UserID, TimeAdded)
180 180
       VALUES
181 181
         ($TorrentID, ".$LoggedUser['ID'].", NOW())");
182
-    $DB->query("
182
+    $DB->prepared_query("
183 183
       SELECT GroupID
184 184
       FROM torrents
185 185
       WHERE ID = $TorrentID");
@@ -188,12 +188,12 @@ if ($DB->affected_rows() > 0 || !$Report) {
188 188
     $SendPM = true;
189 189
   }
190 190
   if ($_POST['resolve_type'] == 'filename') {
191
-    $DB->query("
191
+    $DB->prepared_query("
192 192
       INSERT IGNORE INTO torrents_bad_files
193 193
         (TorrentID, UserID, TimeAdded)
194 194
       VALUES
195 195
         ($TorrentID, ".$LoggedUser['ID'].", NOW())");
196
-    $DB->query("
196
+    $DB->prepared_query("
197 197
       SELECT GroupID
198 198
       FROM torrents
199 199
       WHERE ID = $TorrentID");
@@ -202,7 +202,7 @@ if ($DB->affected_rows() > 0 || !$Report) {
202 202
     $SendPM = true;
203 203
   }
204 204
   if ($_POST['resolve_type'] == 'trump') {
205
-    $DB->query("
205
+    $DB->prepared_query("
206 206
       SELECT
207 207
         r.ExtraID,
208 208
         HEX(t.info_hash)
@@ -214,14 +214,14 @@ if ($DB->affected_rows() > 0 || !$Report) {
214 214
       $ExtraID = explode(' ', $ExtraID)[0];
215 215
 
216 216
       $AffectedUsers = [];
217
-      $DB->query("
217
+      $DB->prepared_query("
218 218
         SELECT UserID
219 219
         FROM torrents
220 220
         WHERE ID = $TorrentID");
221 221
       if ($DB->has_results()) {
222 222
         list($AffectedUsers[]) = $DB->next_record();
223 223
       }
224
-      $DB->query("
224
+      $DB->prepared_query("
225 225
         SELECT uid
226 226
         FROM xbt_snatched
227 227
         WHERE fid = $TorrentID");
@@ -233,7 +233,7 @@ if ($DB->affected_rows() > 0 || !$Report) {
233 233
       $AffectedUsers = array_unique($AffectedUsers);
234 234
       foreach ($AffectedUsers as $UserID) {
235 235
         Tracker::update_tracker('add_token', ['info_hash' => substr('%'.chunk_split($InfoHash,2,'%'),0,-1), 'userid' => $UserID]);
236
-        $DB->query("
236
+        $DB->prepared_query("
237 237
           INSERT INTO users_freeleeches (UserID, TorrentID, Time, Uses)
238 238
           VALUES ($UserID, $ExtraID, NOW(), 0)
239 239
           ON DUPLICATE KEY UPDATE
@@ -248,7 +248,7 @@ if ($DB->affected_rows() > 0 || !$Report) {
248 248
 
249 249
   //Log and delete
250 250
   if (isset($Escaped['delete']) && check_perms('torrents_delete')) {
251
-    $DB->query("
251
+    $DB->prepared_query("
252 252
       SELECT Username
253 253
       FROM users_main
254 254
       WHERE ID = $UploaderID");
@@ -258,7 +258,7 @@ if ($DB->affected_rows() > 0 || !$Report) {
258 258
     if (isset($Escaped['log_message']) && $Escaped['log_message'] != '') {
259 259
       $Log .= ' ( '.$Escaped['log_message'].' )';
260 260
     }
261
-    $DB->query("
261
+    $DB->prepared_query("
262 262
       SELECT GroupID, hex(info_hash)
263 263
       FROM torrents
264 264
       WHERE ID = $TorrentID");
@@ -280,7 +280,7 @@ if ($DB->affected_rows() > 0 || !$Report) {
280 280
     $Cache->update_row(false, array('DisableUpload' => '1'));
281 281
     $Cache->commit_transaction(0);
282 282
 
283
-    $DB->query("
283
+    $DB->prepared_query("
284 284
       UPDATE users_info
285 285
       SET DisableUpload = '1'
286 286
       WHERE UserID = $UploaderID");
@@ -312,7 +312,7 @@ if ($DB->affected_rows() > 0 || !$Report) {
312 312
     if ($AdminComment) {
313 313
       $AdminComment = date('Y-m-d') . " - $AdminComment\n\n";
314 314
 
315
-      $DB->query("
315
+      $DB->prepared_query("
316 316
         UPDATE users_info
317 317
         SET AdminComment = CONCAT('".db_string($AdminComment)."', AdminComment)
318 318
         WHERE UserID = '".db_string($UploaderID)."'");
@@ -360,7 +360,7 @@ if ($DB->affected_rows() > 0 || !$Report) {
360 360
 
361 361
   // Now we've done everything, update the DB with values
362 362
   if ($Report) {
363
-    $DB->query("
363
+    $DB->prepared_query("
364 364
       UPDATE reportsv2
365 365
       SET
366 366
         Type = '".$Escaped['resolve_type']."',

+ 7
- 7
sections/reportsv2/views.php View File

@@ -13,7 +13,7 @@ View::show_header('Reports V2', 'reportsv2');
13 13
 
14 14
 
15 15
 //Grab owner's ID, just for examples
16
-$DB->query("
16
+$DB->prepared_query("
17 17
   SELECT ID, Username
18 18
   FROM users_main
19 19
   ORDER BY ID ASC
@@ -29,7 +29,7 @@ $Owner = display_str($Owner);
29 29
 <div class="float_clear">
30 30
   <div class="two_columns pad">
31 31
 <?
32
-$DB->query("
32
+$DB->prepared_query("
33 33
   SELECT
34 34
     um.ID,
35 35
     um.Username,
@@ -65,7 +65,7 @@ foreach ($Results as $Result) {
65 65
 ?>
66 66
     </table>
67 67
 <?
68
-$DB->query("
68
+$DB->prepared_query("
69 69
   SELECT
70 70
     um.ID,
71 71
     um.Username,
@@ -101,7 +101,7 @@ foreach ($Results as $Result) {
101 101
 ?>
102 102
     </table>
103 103
 <?
104
-$DB->query("
104
+$DB->prepared_query("
105 105
   SELECT
106 106
     um.ID,
107 107
     um.Username,
@@ -137,7 +137,7 @@ foreach ($Results as $Result) {
137 137
 ?>
138 138
     </table>
139 139
 <?
140
-$DB->query("
140
+$DB->prepared_query("
141 141
   SELECT
142 142
     um.ID,
143 143
     um.Username,
@@ -232,7 +232,7 @@ foreach ($Results as $Result) {
232 232
   </div>
233 233
   <div class="two_columns pad">
234 234
 <?
235
-  $DB->query("
235
+  $DB->prepared_query("
236 236
     SELECT
237 237
       r.ResolverID,
238 238
       um.Username,
@@ -268,7 +268,7 @@ foreach ($Results as $Result) {
268 268
     </table>
269 269
     <h3>Different view modes by report type</h3>
270 270
 <?
271
-  $DB->query("
271
+  $DB->prepared_query("
272 272
     SELECT
273 273
       Type,
274 274
       COUNT(ID) AS Count

+ 1
- 1
sections/requests/new_edit.php View File

@@ -97,7 +97,7 @@ if (!$NewRequest) {
97 97
 
98 98
 View::show_header(
99 99
     ($NewRequest ? 'Create Request' : 'Edit Request'),
100
-    'bbcode,requests,upload,form_validate,vendor/easymde.min',
100
+    'requests,upload,form_validate,vendor/easymde.min',
101 101
     'vendor/easymde.min'
102 102
 );
103 103
 ?>

+ 1
- 1
sections/requests/request.php View File

@@ -71,7 +71,7 @@ list($NumComments, $Page, $Thread, $LastRead) = Comments::load('requests', $Requ
71 71
 
72 72
 View::show_header(
73 73
     "View request: $Title",
74
-    'comments,requests,bbcode,subscriptions,vendor/easymde.min',
74
+    'comments,requests,subscriptions,vendor/easymde.min',
75 75
     'vendor/easymde.min'
76 76
 );
77 77
 ?>

+ 1
- 1
sections/staffpm/viewconv.php View File

@@ -33,7 +33,7 @@ if ($ConvID = (int)$_GET['id']) {
33 33
 
34 34
     View::show_header(
35 35
         'Staff PM',
36
-        'staffpm,bbcode,vendor/easymde.min',
36
+        'staffpm,vendor/easymde.min',
37 37
         'vendor/easymde.min'
38 38
     );
39 39
 

+ 4
- 4
sections/tools/finances/donation_log.php View File

@@ -58,20 +58,20 @@ if ($DateSearch) {
58 58
 $SQL .= "
59 59
   ORDER BY d.Time DESC
60 60
   LIMIT $Limit";
61
-$DB->query($SQL);
61
+$DB->prepared_query($SQL);
62 62
 $Donations = $DB->to_array();
63 63
 
64
-$DB->query('SELECT FOUND_ROWS()');
64
+$DB->prepared_query('SELECT FOUND_ROWS()');
65 65
 list($Results) = $DB->next_record();
66 66
 
67
-$DB->query("SELECT SUM(Amount) FROM donations");
67
+$DB->prepared_query("SELECT SUM(Amount) FROM donations");
68 68
 list($Total) = $DB->next_record();
69 69
 
70 70
 /*
71 71
 if (empty($_GET['email']) && empty($_GET['username']) && empty($_GET['source']) && !isset($_GET['page']) && !$DonationTimeline = $Cache->get_value('donation_timeline')) {
72 72
     include(SERVER_ROOT.'/classes/charts.class.php');
73 73
 
74
-    $DB->query("
74
+    $DB->prepared_query("
75 75
     SELECT DATE_FORMAT(Time,'%b \'%y') AS Month, SUM(Amount)
76 76
     FROM donations
77 77
     GROUP BY Month

+ 2
- 2
sections/tools/finances/donor_rewards.php View File

@@ -14,7 +14,7 @@ if ($_GET['username']) {
14 14
 
15 15
 $Title = "Donor Rewards";
16 16
 
17
-$DB->query("
17
+$DB->prepared_query("
18 18
   SELECT
19 19
     SQL_CALC_FOUND_ROWS
20 20
     u.Username,
@@ -35,7 +35,7 @@ $DB->query("
35 35
   LIMIT $Limit");
36 36
 
37 37
 $Users = $DB->to_array();
38
-$DB->query('SELECT FOUND_ROWS()');
38
+$DB->prepared_query('SELECT FOUND_ROWS()');
39 39
 list($Results) = $DB->next_record();
40 40
 $Pages = Format::get_pages($Page, $Results, USERS_PER_PAGE, 9);
41 41
 

+ 0
- 4
sections/tools/index.php View File

@@ -80,10 +80,6 @@ switch ($_REQUEST['action']) {
80 80
     include SERVER_ROOT.'/sections/tools/managers/enable_requests.php';
81 81
     break;
82 82
 
83
-  case 'expunge_requests':
84
-    include SERVER_ROOT.'/sections/tools/managers/expunge_requests.php';
85
-    break;
86
-
87 83
   case 'ajax_take_enable_request':
88 84
     if (FEATURE_EMAIL_REENABLE) {
89 85
         include SERVER_ROOT.'/sections/tools/managers/ajax_take_enable_request.php';

+ 3
- 3
sections/tools/managers/bans.php View File

@@ -11,8 +11,8 @@ if (isset($_POST['submit'])) {
11 11
     authorize();
12 12
 
13 13
     $IPA = substr($_POST['start'], 0, strcspn($_POST['start'], '.'));
14
-    if ($_POST['submit'] == 'Delete') { //Delete
15
-        if (!is_number($_POST['id']) || $_POST['id'] == '') {
14
+    if ($_POST['submit'] === 'Delete') { //Delete
15
+        if (!is_number($_POST['id']) || $_POST['id'] === '') {
16 16
             error(0);
17 17
         }
18 18
         $DB->query('DELETE FROM ip_bans WHERE ID='.$_POST['id']);
@@ -30,7 +30,7 @@ if (isset($_POST['submit'])) {
30 30
         $Start = Tools::ip_to_unsigned($_POST['start']); //Sanitized by Validation regex
31 31
     $End = Tools::ip_to_unsigned($_POST['end']); //See above
32 32
 
33
-    if ($_POST['submit'] == 'Edit') { //Edit
33
+    if ($_POST['submit'] === 'Edit') { //Edit
34 34
         if (empty($_POST['id']) || !is_number($_POST['id'])) {
35 35
             error(404);
36 36
         }

+ 2
- 2
sections/tools/managers/email_blacklist.php View File

@@ -20,7 +20,7 @@ if (!empty($_POST['comment'])) {
20 20
   }
21 21
   $Where .= " Comment LIKE '%$Comment%'";
22 22
 }
23
-$DB->query("
23
+$DB->prepared_query("
24 24
   SELECT
25 25
     SQL_CALC_FOUND_ROWS
26 26
     ID,
@@ -33,7 +33,7 @@ $DB->query("
33 33
   ORDER BY Time DESC
34 34
   LIMIT $Limit");
35 35
 $Results = $DB->to_array(false, MYSQLI_ASSOC, false);
36
-$DB->query('SELECT FOUND_ROWS()');
36
+$DB->prepared_query('SELECT FOUND_ROWS()');
37 37
 list ($NumResults) = $DB->next_record();
38 38
 ?>
39 39
 <div class="header">

+ 3
- 3
sections/tools/managers/email_blacklist_alter.php View File

@@ -9,7 +9,7 @@ if ($_POST['submit'] === 'Delete') { // Delete
9 9
   if (!is_number($_POST['id']) || $_POST['id'] === '') {
10 10
     error(0);
11 11
   }
12
-  $DB->query("
12
+  $DB->prepared_query("
13 13
     DELETE FROM email_blacklist
14 14
     WHERE ID = $_POST[id]");
15 15
 } else { // Edit & Create, Shared Validation
@@ -27,7 +27,7 @@ if ($_POST['submit'] === 'Delete') { // Delete
27 27
     if (!is_number($_POST['id']) || $_POST['id'] === '') {
28 28
       error(0);
29 29
     }
30
-    $DB->query("
30
+    $DB->prepared_query("
31 31
       UPDATE email_blacklist
32 32
       SET
33 33
         Email = '$P[email]',
@@ -36,7 +36,7 @@ if ($_POST['submit'] === 'Delete') { // Delete
36 36
         Time = NOW()
37 37
       WHERE ID = '$P[id]'");
38 38
   } else { // Create
39
-    $DB->query("
39
+    $DB->prepared_query("
40 40
       INSERT INTO email_blacklist (Email, Comment, UserID, Time)
41 41
       VALUES ('$P[email]', '$P[comment]', '$LoggedUser[ID]', NOW())");
42 42
   }

+ 1
- 1
sections/tools/managers/email_blacklist_search.php View File

@@ -10,7 +10,7 @@ else {
10 10
   $JSON['status'] = 'success';
11 11
 }
12 12
 
13
-$DB->query("
13
+$DB->prepared_query("
14 14
   SELECT
15 15
     ID,
16 16
     UserID,

+ 0
- 108
sections/tools/managers/expunge_requests.php View File

@@ -1,108 +0,0 @@
1
-<?php
2
-#declare(strict_types=1);
3
-
4
-if (!check_perms('users_mod')) {
5
-  error(403);
6
-}
7
-
8
-$QueryID = $DB->query("
9
-  SELECT SQL_CALC_FOUND_ROWS *
10
-  FROM deletion_requests");
11
-
12
-$DB->query("SELECT FOUND_ROWS()");
13
-list($NumResults) = $DB->next_record();
14
-$DB->set_query_id($QueryID);
15
-
16
-$Requests = $DB->to_array();
17
-
18
-if (isset($_GET['deny']) && isset($_GET['type']) && isset($_GET['value'])) {
19
-  authorize();
20
-
21
-  $Deny = ($_GET['deny'] == 'true');
22
-  $Type = $_GET['type'] == 'email' ? 'Email' : ($_GET['type'] == 'ip' ? 'IP' : '');
23
-  $Value = db_string($_GET['value']);
24
-
25
-  $DB->query("
26
-    DELETE FROM deletion_requests
27
-    WHERE Value = '$Value'");
28
-
29
-  $DB->query("
30
-    SELECT UserID
31
-    FROM users_history_".strtolower($Type)."s
32
-    WHERE $Type = '$Value'");
33
-  if ($DB->has_results()) {
34
-    list($UserID) = $DB->next_record();
35
-    if ($UserID != $_GET['userid']) {
36
-      $Err = "The specified UserID is incorrect.";
37
-    }
38
-  } else {
39
-    $Err = "That $Type doesn't exist.";
40
-  }
41
-
42
-  if (empty($Err)) {
43
-    if (!$Deny) {
44
-      $DB->query("
45
-        SELECT $Type
46
-        FROM users_history_".strtolower($Type)."s
47
-        WHERE UserID = '$UserID'");
48
-      $ToDelete = [];
49
-      while (list($EncValue) = $DB->next_record()) {
50
-        if (Crypto::decrypt($Value) == Crypto::decrypt($EncValue)) {
51
-          $ToDelete[] = $EncValue;
52
-        }
53
-      }
54
-      forEach ($ToDelete as $DelValue) {
55
-        $DB->query("
56
-          DELETE FROM users_history_".strtolower($Type)."s
57
-          WHERE UserID = $UserID
58
-            AND $Type = '$DelValue'");
59
-      }
60
-      $Succ = "$Type deleted.";
61
-      Misc::send_pm($UserID, 0, "$Type Deletion Request Accepted.", "Your deletion request has been accepted. What $Type? I don't know! We don't have it anymore!");
62
-    } else {
63
-      $Succ = "Request denied.";
64
-      Misc::send_pm($UserID, 0, "$Type Deletion Request Denied.", "Your deletion request has been denied.\n\nIf you wish to discuss this matter further, please create a staff PM, or join ".HELP_CHAN." on IRC to speak with a staff member.");
65
-    }
66
-  }
67
-
68
-  $Cache->delete_value('num_deletion_requests');
69
-}
70
-
71
-View::show_header("Expunge Requests");
72
-
73
-?>
74
-
75
-<div class="header">
76
-  <h2>Expunge Requests</h2>
77
-</div>
78
-
79
-<? if (isset($Err)) { ?>
80
-<span>Error: <?=$Err?></span>
81
-<? } elseif (isset($Succ)) { ?>
82
-<span>Success: <?=$Succ?></span>
83
-<? } ?>
84
-
85
-<div>
86
-  <table width="100%">
87
-    <tr class="colhead">
88
-      <td>User</td>
89
-      <td>Type</td>
90
-      <td>Value</td>
91
-      <td>Reason</td>
92
-      <td>Accept</td>
93
-      <td>Deny</td>
94
-    </tr>
95
-<? foreach ($Requests as $Request) { ?>
96
-    <tr>
97
-      <td><?=Users::format_username($Request['UserID'])?></td>
98
-      <td><?=$Request['Type']?></td>
99
-      <td><?=Crypto::decrypt($Request['Value'])?></td>
100
-      <td><?=display_str($Request['Reason'])?></td>
101
-      <td><a href="tools.php?action=expunge_requests&auth=<?=$LoggedUser['AuthKey']?>&type=<?=strtolower($Request['Type'])?>&value=<?=urlencode($Request['Value'])?>&userid=<?=$Request['UserID']?>&deny=false" class="brackets">Accept</a></td>
102
-      <td><a href="tools.php?action=expunge_requests&auth=<?=$LoggedUser['AuthKey']?>&type=<?=strtolower($Request['Type'])?>&value=<?=urlencode($Request['Value'])?>&userid=<?=$Request['UserID']?>&deny=true" class="brackets">Deny</a></td>
103
-    </tr>
104
-<? } ?>
105
-  </table>
106
-</div>
107
-
108
-<? View::show_footer(); ?>

+ 1
- 1
sections/tools/managers/mass_pm.php View File

@@ -12,7 +12,7 @@ $SkipClassIDs = array(USER, MEMBER, POWER, ELITE, TORRENT_MASTER, DONOR, POWER_T
12 12
 
13 13
 View::show_header(
14 14
     'Compose Mass PM',
15
-    'inbox,bbcode,vendor/jquery.validate.min,form_validate'
15
+    'inbox,vendor/jquery.validate.min,form_validate'
16 16
 ); ?>
17 17
 
18 18
 <main>

+ 1
- 1
sections/tools/managers/news.php View File

@@ -8,7 +8,7 @@ if (!check_perms('admin_manage_news')) {
8 8
 
9 9
 View::show_header(
10 10
     'Manage news',
11
-    'bbcode,vendor/easymde.min',
11
+    'vendor/easymde.min',
12 12
     'vendor/easymde.min'
13 13
 );
14 14
 

+ 4
- 4
sections/tools/misc/create_user.php View File

@@ -24,7 +24,7 @@ if (isset($_POST['Username'])) {
24 24
     $torrent_pass = Users::make_secret();
25 25
 
26 26
     //Create the account
27
-    $DB->query("
27
+    $DB->prepared_query("
28 28
       INSERT INTO users_main
29 29
         (Username, Email, PassHash, torrent_pass, Enabled, PermissionID)
30 30
       VALUES
@@ -39,7 +39,7 @@ if (isset($_POST['Username'])) {
39 39
     Tracker::update_tracker('add_user', array('id' => $UserID, 'passkey' => $torrent_pass));
40 40
 
41 41
     //Default stylesheet
42
-    $DB->query("
42
+    $DB->prepared_query("
43 43
       SELECT ID
44 44
       FROM stylesheets");
45 45
     list($StyleID) = $DB->next_record();
@@ -48,14 +48,14 @@ if (isset($_POST['Username'])) {
48 48
     $AuthKey = Users::make_secret();
49 49
 
50 50
     //Give them a row in users_info
51
-    $DB->query("
51
+    $DB->prepared_query("
52 52
       INSERT INTO users_info
53 53
         (UserID, StyleID, AuthKey, JoinDate)
54 54
       VALUES
55 55
         ('".db_string($UserID)."', '".db_string($StyleID)."', '".db_string($AuthKey)."', NOW())");
56 56
 
57 57
     // Give the notification settings
58
-    $DB->query("INSERT INTO users_notifications_settings (UserID) VALUES ('$UserID')");
58
+    $DB->prepared_query("INSERT INTO users_notifications_settings (UserID) VALUES ('$UserID')");
59 59
 
60 60
     //Redirect to users profile
61 61
     header ("Location: user.php?id=$UserID");

+ 1
- 1
sections/top10/donors.php View File

@@ -15,7 +15,7 @@ $Limit = isset($_GET['limit']) ? intval($_GET['limit']) : 10;
15 15
 $Limit = in_array($Limit, array(10, 100, 250)) ? $Limit : 10;
16 16
 
17 17
 $IsMod = check_perms("users_mod");
18
-$DB->query("
18
+$DB->prepared_query("
19 19
 SELECT
20 20
   `UserID`,
21 21
   `TotalRank`,

+ 1
- 1
sections/top10/history.php View File

@@ -66,7 +66,7 @@ if (!empty($_GET['date'])) {
66 66
 
67 67
     $Details = $Cache->get_value("top10_history_$SQLTime");
68 68
     if ($Details === false) {
69
-        $DB->query("
69
+        $DB->prepared_query("
70 70
         SELECT
71 71
           tht.`Rank`,
72 72
           tht.`TitleString`,

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

@@ -28,7 +28,7 @@ $Limit = in_array($Limit, [10,100,250]) ? $Limit : 10;
28 28
 
29 29
 if ($Details == 'all' || $Details == 'ut') {
30 30
     if (!$TopUsedTags = $Cache->get_value('topusedtag_'.$Limit)) {
31
-        $DB->query("
31
+        $DB->prepared_query("
32 32
         SELECT
33 33
           t.ID,
34 34
           t.Name,
@@ -47,7 +47,7 @@ if ($Details == 'all' || $Details == 'ut') {
47 47
 
48 48
 if ($Details == 'all' || $Details == 'ur') {
49 49
     if (!$TopRequestTags = $Cache->get_value('toprequesttag_'.$Limit)) {
50
-        $DB->query("
50
+        $DB->prepared_query("
51 51
         SELECT
52 52
           t.ID,
53 53
           t.Name,

+ 8
- 8
sections/top10/torrents.php View File

@@ -208,7 +208,7 @@ if ($Details === 'all' || $Details === 'day') {
208 208
               ORDER BY (t.Seeders + t.Leechers) DESC
209 209
               LIMIT $Limit;";
210 210
 
211
-            $DB->query($Query);
211
+            $DB->prepared_query($Query);
212 212
             $TopTorrentsActiveLastDay = $DB->to_array(false, MYSQLI_NUM);
213 213
             $Cache->cache_value('top10tor_day_'.$Limit.$WhereSum.$GroupBySum, $TopTorrentsActiveLastDay, 3600 * 2);
214 214
             $Cache->clear_query_lock('top10');
@@ -235,7 +235,7 @@ if ($Details === 'all' || $Details === 'week') {
235 235
               ORDER BY (t.Seeders + t.Leechers) DESC
236 236
               LIMIT $Limit;";
237 237
 
238
-            $DB->query($Query);
238
+            $DB->prepared_query($Query);
239 239
             $TopTorrentsActiveLastWeek = $DB->to_array(false, MYSQLI_NUM);
240 240
             $Cache->cache_value('top10tor_week_'.$Limit.$WhereSum.$GroupBySum, $TopTorrentsActiveLastWeek, 3600 * 6);
241 241
             $Cache->clear_query_lock('top10');
@@ -262,7 +262,7 @@ if ($Details === 'all' || $Details === 'month') {
262 262
               ORDER BY (t.Seeders + t.Leechers) DESC
263 263
               LIMIT $Limit;";
264 264
 
265
-            $DB->query($Query);
265
+            $DB->prepared_query($Query);
266 266
             $TopTorrentsActiveLastMonth = $DB->to_array(false, MYSQLI_NUM);
267 267
             $Cache->cache_value('top10tor_month_'.$Limit.$WhereSum.$GroupBySum, $TopTorrentsActiveLastMonth, 3600 * 6);
268 268
             $Cache->clear_query_lock('top10');
@@ -294,7 +294,7 @@ if ($Details === 'all' || $Details === 'year') {
294 294
               ORDER BY (t.Seeders + t.Leechers) DESC
295 295
               LIMIT $Limit;";
296 296
 
297
-            $DB->query($Query);
297
+            $DB->prepared_query($Query);
298 298
             $TopTorrentsActiveLastYear = $DB->to_array(false, MYSQLI_NUM);
299 299
             $Cache->cache_value('top10tor_year_'.$Limit.$WhereSum.$GroupBySum, $TopTorrentsActiveLastYear, 3600 * 6);
300 300
             $Cache->clear_query_lock('top10');
@@ -325,7 +325,7 @@ if ($Details === 'all' || $Details === 'overall') {
325 325
               ORDER BY (t.Seeders + t.Leechers) DESC
326 326
               LIMIT $Limit;";
327 327
 
328
-            $DB->query($Query);
328
+            $DB->prepared_query($Query);
329 329
             $TopTorrentsActiveAllTime = $DB->to_array(false, MYSQLI_NUM);
330 330
             $Cache->cache_value('top10tor_overall_'.$Limit.$WhereSum.$GroupBySum, $TopTorrentsActiveAllTime, 3600 * 6);
331 331
             $Cache->clear_query_lock('top10');
@@ -351,7 +351,7 @@ if (($Details === 'all' || $Details === 'snatched') && !$Filtered) {
351 351
               ORDER BY t.Snatched DESC
352 352
               LIMIT $Limit;";
353 353
 
354
-            $DB->query($Query);
354
+            $DB->prepared_query($Query);
355 355
             $TopTorrentsSnatched = $DB->to_array(false, MYSQLI_NUM);
356 356
             $Cache->cache_value('top10tor_snatched_'.$Limit.$WhereSum.$GroupBySum, $TopTorrentsSnatched, 3600 * 6);
357 357
             $Cache->clear_query_lock('top10');
@@ -380,7 +380,7 @@ if (($Details === 'all' || $Details === 'data') && !$Filtered) {
380 380
               ORDER BY Data DESC
381 381
               LIMIT $Limit;";
382 382
 
383
-            $DB->query($Query);
383
+            $DB->prepared_query($Query);
384 384
             $TopTorrentsTransferred = $DB->to_array(false, MYSQLI_NUM);
385 385
             $Cache->cache_value('top10tor_data_'.$Limit.$WhereSum.$GroupBySum, $TopTorrentsTransferred, 3600 * 6);
386 386
             $Cache->clear_query_lock('top10');
@@ -405,7 +405,7 @@ if (($Details === 'all' || $Details === 'seeded') && !$Filtered) {
405 405
               ORDER BY t.Seeders DESC
406 406
               LIMIT $Limit;";
407 407
 
408
-            $DB->query($Query);
408
+            $DB->prepared_query($Query);
409 409
             $TopTorrentsSeeded = $DB->to_array(false, MYSQLI_NUM);
410 410
             $Cache->cache_value('top10tor_seeded_'.$Limit.$WhereSum.$GroupBySum, $TopTorrentsSeeded, 3600 * 6);
411 411
             $Cache->clear_query_lock('top10');

+ 5
- 5
sections/top10/users.php View File

@@ -48,7 +48,7 @@ $BaseQuery = "
48 48
 
49 49
   if ($Details == 'all' || $Details == 'ul') {
50 50
       if (!$TopUserUploads = $Cache->get_value('topuser_ul_'.$Limit)) {
51
-          $DB->query("$BaseQuery ORDER BY u.Uploaded DESC LIMIT $Limit;");
51
+          $DB->prepared_query("$BaseQuery ORDER BY u.Uploaded DESC LIMIT $Limit;");
52 52
           $TopUserUploads = $DB->to_array();
53 53
           $Cache->cache_value('topuser_ul_'.$Limit, $TopUserUploads, 3600 * 12);
54 54
       }
@@ -57,7 +57,7 @@ $BaseQuery = "
57 57
 
58 58
   if ($Details == 'all' || $Details == 'dl') {
59 59
       if (!$TopUserDownloads = $Cache->get_value('topuser_dl_'.$Limit)) {
60
-          $DB->query("$BaseQuery ORDER BY u.Downloaded DESC LIMIT $Limit;");
60
+          $DB->prepared_query("$BaseQuery ORDER BY u.Downloaded DESC LIMIT $Limit;");
61 61
           $TopUserDownloads = $DB->to_array();
62 62
           $Cache->cache_value('topuser_dl_'.$Limit, $TopUserDownloads, 3600 * 12);
63 63
       }
@@ -66,7 +66,7 @@ $BaseQuery = "
66 66
 
67 67
   if ($Details == 'all' || $Details == 'numul') {
68 68
       if (!$TopUserNumUploads = $Cache->get_value('topuser_numul_'.$Limit)) {
69
-          $DB->query("$BaseQuery ORDER BY NumUploads DESC LIMIT $Limit;");
69
+          $DB->prepared_query("$BaseQuery ORDER BY NumUploads DESC LIMIT $Limit;");
70 70
           $TopUserNumUploads = $DB->to_array();
71 71
           $Cache->cache_value('topuser_numul_'.$Limit, $TopUserNumUploads, 3600 * 12);
72 72
       }
@@ -75,7 +75,7 @@ $BaseQuery = "
75 75
 
76 76
   if ($Details == 'all' || $Details == 'uls') {
77 77
       if (!$TopUserUploadSpeed = $Cache->get_value('topuser_ulspeed_'.$Limit)) {
78
-          $DB->query("$BaseQuery ORDER BY UpSpeed DESC LIMIT $Limit;");
78
+          $DB->prepared_query("$BaseQuery ORDER BY UpSpeed DESC LIMIT $Limit;");
79 79
           $TopUserUploadSpeed = $DB->to_array();
80 80
           $Cache->cache_value('topuser_ulspeed_'.$Limit, $TopUserUploadSpeed, 3600 * 12);
81 81
       }
@@ -84,7 +84,7 @@ $BaseQuery = "
84 84
 
85 85
   if ($Details == 'all' || $Details == 'dls') {
86 86
       if (!$TopUserDownloadSpeed = $Cache->get_value('topuser_dlspeed_'.$Limit)) {
87
-          $DB->query("$BaseQuery ORDER BY DownSpeed DESC LIMIT $Limit;");
87
+          $DB->prepared_query("$BaseQuery ORDER BY DownSpeed DESC LIMIT $Limit;");
88 88
           $TopUserDownloadSpeed = $DB->to_array();
89 89
           $Cache->cache_value('topuser_dlspeed_'.$Limit, $TopUserDownloadSpeed, 3600 * 12);
90 90
       }

+ 1
- 1
sections/torrents/details.php View File

@@ -118,7 +118,7 @@ list($NumComments, $Page, $Thread, $LastRead) = Comments::load('torrents', $Grou
118 118
 // Start output
119 119
 View::show_header(
120 120
     $Title,
121
-    'browse,comments,torrent,bbcode,recommend,cover_art,subscriptions,vendor/easymde.min',
121
+    'browse,comments,torrent,recommend,cover_art,subscriptions,vendor/easymde.min',
122 122
     'vendor/easymde.min'
123 123
 );
124 124
 ?>

+ 1
- 1
sections/torrents/edit.php View File

@@ -92,7 +92,7 @@ if (($LoggedUser['ID'] !== $Properties['UserID']
92 92
  * Commenting only to see it better.
93 93
  */
94 94
 
95
-View::show_header('Edit torrent', 'upload,torrent,bbcode');
95
+View::show_header('Edit torrent', 'upload,torrent');
96 96
 $TorrentForm = new TorrentForm(
97 97
     $Torrent = $Properties,
98 98
     $Error = $Err,

+ 1
- 1
sections/torrents/editgroup.php View File

@@ -70,7 +70,7 @@ if (!$Body) {
70 70
 
71 71
 View::show_header(
72 72
     'Edit torrent group',
73
-    'upload,bbcode,vendor/easymde.min',
73
+    'upload,vendor/easymde.min',
74 74
     'vendor/easymde.min'
75 75
 ); ?>
76 76
 

+ 7
- 3
sections/torrents/index.php View File

@@ -197,8 +197,13 @@ if (!empty($_REQUEST['action'])) {
197 197
             break;
198 198
             
199 199
         case 'fix_group':
200
-            if ((check_perms('users_mod') || check_perms('torrents_fix_ghosts')) && authorize() && !empty($_GET['groupid']) && is_number($_GET['groupid'])) {
201
-                $DB->prepare_query("
200
+            if ((check_perms('users_mod') || check_perms('torrents_fix_ghosts'))
201
+              && !empty($_GET['groupid'])
202
+              && is_number($_GET['groupid'])
203
+                ) {
204
+                authorize();
205
+
206
+                $DB->prepared_query("
202 207
                 SELECT
203 208
                   COUNT(`ID`)
204 209
                 FROM
@@ -206,7 +211,6 @@ if (!empty($_REQUEST['action'])) {
206 211
                 WHERE
207 212
                   `GroupID` = '$_GET[groupid]'
208 213
                 ");
209
-                $DB->exec_prepared_query();
210 214
                 list($Count) = $DB->next_record();
211 215
                 
212 216
                 if ($Count === 0) {

+ 1
- 1
sections/upload/upload.php View File

@@ -14,7 +14,7 @@ declare(strict_types=1);
14 14
 
15 15
 View::show_header(
16 16
     'Upload',
17
-    'upload,bbcode,vendor/easymde.min',
17
+    'upload,vendor/easymde.min',
18 18
     'vendor/easymde.min'
19 19
 );
20 20
 

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

@@ -69,7 +69,7 @@ if ($SiteOptions) {
69 69
  */
70 70
 View::show_header(
71 71
     "$Username $ENV->CRUMB Settings",
72
-    'user,password_validate,validate,cssgallery,preview_paranoia,bbcode,user_settings,donor_titles,vendor/easymde.min',
72
+    'user,password_validate,validate,cssgallery,preview_paranoia,user_settings,vendor/easymde.min',
73 73
     'vendor/easymde.min'
74 74
 );
75 75
 

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

@@ -233,7 +233,7 @@ function check_paranoia_here($Setting)
233 233
 
234 234
 View::show_header(
235 235
     $Username,
236
-    'vendor/imagesloaded.min,user,bbcode,requests,comments,info_paster,wall'
236
+    'vendor/imagesloaded.min,user,requests,comments,info_paster,wall'
237 237
 );
238 238
 
239 239
 ?>

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

@@ -23,7 +23,7 @@ list($Page, $Limit) = Format::page_limit($PerPage);
23 23
 $UserInfo = Users::user_info($UserID);
24 24
 extract(array_intersect_key($UserInfo, array_flip(array('Username', 'Enabled', 'Title', 'Avatar', 'Donor', 'Warned'))));
25 25
 
26
-View::show_header("Post history for $Username", 'subscriptions,comments,bbcode');
26
+View::show_header("Post history for $Username", 'subscriptions,comments');
27 27
 
28 28
 $ViewingOwn = ($UserID == $LoggedUser['ID']);
29 29
 $ShowUnread = ($ViewingOwn && (!isset($_GET['showunread']) || !!$_GET['showunread']));

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

@@ -12,7 +12,7 @@ if (isset($LoggedUser['PostsPerPage'])) {
12 12
 }
13 13
 list($Page, $Limit) = Format::page_limit($PerPage);
14 14
 
15
-View::show_header('Subscriptions', 'subscriptions,bbcode');
15
+View::show_header('Subscriptions', 'subscriptions');
16 16
 
17 17
 $ShowUnread = (!isset($_GET['showunread']) && !isset($HeavyInfo['SubscriptionsUnread']) || isset($HeavyInfo['SubscriptionsUnread']) && !!$HeavyInfo['SubscriptionsUnread'] || isset($_GET['showunread']) && !!$_GET['showunread']);
18 18
 $ShowCollapsed = (!isset($_GET['collapse']) && !isset($HeavyInfo['SubscriptionsCollapse']) || isset($HeavyInfo['SubscriptionsCollapse']) && !!$HeavyInfo['SubscriptionsCollapse'] || isset($_GET['collapse']) && !!$_GET['collapse']);

+ 1
- 1
sections/wiki/article.php View File

@@ -49,7 +49,7 @@ if ($Read > $LoggedUser['EffectiveClass']) {
49 49
 $TextBody = Text::full_format($Body, false);
50 50
 $TOC = Text::parse_toc(0);
51 51
 
52
-View::show_header($Title, 'wiki,bbcode');
52
+View::show_header($Title, 'wiki');
53 53
 ?>
54 54
 
55 55
 <div>

+ 1
- 1
sections/wiki/create.php View File

@@ -3,7 +3,7 @@ declare(strict_types = 1);
3 3
 
4 4
 View::show_header(
5 5
     'Create an article',
6
-    'bbcode,vendor/easymde.min',
6
+    'vendor/easymde.min',
7 7
     'vendor/easymde.min'
8 8
 );
9 9
 ?>

+ 1
- 1
sections/wiki/edit.php View File

@@ -15,7 +15,7 @@ if ($Edit > $LoggedUser['EffectiveClass']) {
15 15
 
16 16
 View::show_header(
17 17
     'Edit '.$Title,
18
-    'bbcode,vendor/easymde.min',
18
+    'vendor/easymde.min',
19 19
     'vendor/easymde.min'
20 20
 );
21 21
 ?>

+ 6
- 0
static/common/symbols/external-link-ltr-icon.svg View File

@@ -0,0 +1,6 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12">
3
+	<path fill="#fff" stroke="#36c" d="M1.5 4.518h5.982V10.5H1.5z"/>
4
+	<path fill="#36c" d="M5.765 1H11v5.39L9.427 7.937l-1.31-1.31L5.393 9.35l-2.69-2.688 2.81-2.808L4.2 2.544z"/>
5
+	<path fill="#fff" d="m9.995 2.004.022 4.885L8.2 5.07 5.32 7.95 4.09 6.723l2.882-2.88-1.85-1.852z"/>
6
+</svg>

BIN
static/common/symbols/external.png View File


+ 0
- 142
static/functions/bbcode.js View File

@@ -1,142 +0,0 @@
1
-/**
2
- * BBSpoiler
3
- */
4
-function BBSpoiler(link) {
5
-  if ($(link.nextSibling).has_class('hidden')) {
6
-    $(link.nextSibling).gshow();
7
-    $(link).html('Hide');
8
-
9
-    if ($(link).attr("value")) {
10
-      $(link).attr("value", "Hide" + $(link).attr("value").substring(4))
11
-    }
12
-  } else {
13
-    $(link.nextSibling).ghide();
14
-    $(link).html('Show');
15
-
16
-    if ($(link).attr("value")) {
17
-      $(link).attr("value", "Show" + $(link).attr("value").substring(4))
18
-    }
19
-  }
20
-}
21
-
22
-/**
23
- * wrapSelected
24
- */
25
-function wrapSelected(box, wrap, offset) {
26
-  if (!Array.isArray(wrap)) wrap = [wrap, wrap]
27
-  if (wrap.length < 2) wrap[1] = wrap[0]
28
-
29
-  var s = box.selectionStart
30
-  var e = box.selectionEnd
31
-  var v = box.value
32
-
33
-  box.value = v.slice(0, s) + wrap[0] + v.slice(s, e) + wrap[1] + v.slice(e)
34
-  box.focus()
35
-  box.selectionEnd = (offset !== undefined ? s + offset : e + wrap[0].length)
36
-}
37
-
38
-/**
39
- * EmojiBox
40
- */
41
-function EmojiBox(box) {
42
-  /*
43
-  let opened = false
44
-  let emojis = ['😀', '😁', '😂', '🤣', '😃', '😄', '😅', '😆', '😉', '😊', '😋', '😎', '😍', '😘', '😗', '😙', '😚', '🙂', '🤗', '🤔', '😐', '😑', '😶', '🙄', '😏', '😣', '😥', '😮', '🤐', '😯', '😪', '😫', '😴', '😌', '😛', '😜', '😝', '🤤', '😒', '😓', '😔', '😕', '🙃', '🤑', '😲', '🙁', '😖', '😞', '😟', '😤', '😢', '😭', '😦', '😧', '😨', '😩', '😬', '😰', '😱', '😳', '😵', '😡', '😠', '😷', '🤒', '🤕', '🤢', '🤧', '😇', '🤠', '🤡', '🤥', '🤓', '\n', '😈', '👿', '👹', '👺', '💀', '👻', '👽', '🤖', '💩', '😺', '😸', '😹', '😻', '😼', '😽', '🙀', '😿', '😾', '\n', '🍇', '🍈', '🍉', '🍊', '🍋', '🍌', '🍍', '🍎', '🍏', '🍐', '🍑', '🍒', '🍓', '🥝', '🍅', '🥑', '🍆', '🥔', '🥕', '🌽', '🌶', '🥒', '🍄', '🥜', '🌰', '🍞', '🥐', '🥖', '🥞', '🧀', '🍖', '🍗', '🥓', '🍔', '🍟', '🍕', '🌭', '🌮', '🌯', '🍳', '🍲', '🥗', '🍿', '🍱', '🍘', '🍙', '🍚', '🍛', '🍜', '🍝', '🍠', '🍢', '🍣', '🍤', '🍥', '🍡', '🍦', '🍧', '🍨', '🍩', '🍪', '🎂', '🍰', '🍫', '🍬', '🍭', '🍮', '🍯', '🍼', '🥛', '🍵', '🍶', '🍾', '🍷', '🍸', '🍹', '🍺', '🍻', '🥂', '🥃', '🍽', '🍴', '🥄', '\n', '🛀', '🛌', '💌', '💣', '🕳', '🛍', '📿', '💎', '🔪', '🏺', '🗺', '💈', '🛢', '🛎', '⌛', '⏳', '⌚', '⏰', '⏱', '⏲', '🕰', '🌡', '⛱', '🎈', '🎉', '🎊', '🎎', '🎏', '🎐', '🎀', '🎁', '🔮', '🕹', '🖼', '📯', '🎙', '🎚', '🎛', '📻', '📱', '📲', '📞', '📟', '📠', '🔋', '🔌', '💻', '🖥', '🖨', '🖱', '🖲', '💽', '💾', '💿', '📀', '🎥', '🎞', '📽', '📺', '📷', '📸', '📹', '📼', '🔍', '🔎', '🕯', '💡', '🔦', '🏮', '📔', '📕', '📖', '📗', '📘', '📙', '📚', '📓', '📃', '📜', '📄', '📰', '🗞', '📑', '🔖', '🏷', '💰', '💴', '💵', '💶', '💷', '💸', '💳', '📧', '📨', '📩', '📤', '📥', '📦', '📫', '📪', '📬', '📭', '📮', '🗳', '🖋', '🖊', '🖌', '🖍', '📝', '📁', '📂', '🗂', '📅', '📆', '🗒', '🗓', '📇', '📈', '📉', '📊', '📋', '📌', '📍', '📎', '🖇', '📏', '📐', '🗃', '🗄', '🗑', '🔒', '🔓', '🔏', '🔐', '🔑', '🗝', '🔨', '⛏', '🛠', '🗡', '🔫', '🛡', '🔧', '🔩', '🗜', '🔗', '⛓', '🔬', '🔭', '📡', '💉', '💊', '🚪', '🛏', '🛋', '🚽', '🚿', '🛁', '🚬', '🗿', '🚰', '\n', '💪', '👈', '👉', '👆', '🖕', '👇', '🤞', '🖖', '🤘', '🖐', '✋', '👌', '👍', '👎', '✊', '👊', '🤛', '🤜', '🤚', '👋', '👏', '👐', '🙌', '🙏', '🤝']
45
-  let ebox = document.createElement('div')
46
-  ebox.className = 'emoji_box border'
47
-
48
-  for (let emoji of emojis) {
49
-    if (emoji === '\n') {
50
-      let br = document.createElement('br')
51
-      ebox.appendChild(br)
52
-      continue;
53
-    }
54
-
55
-    let a = document.createElement('a')
56
-    a.innerHTML = emoji
57
-    a.addEventListener('click', e => {
58
-      wrapSelected(box, [emoji, ''])
59
-      e.stopPropagation()
60
-    })
61
-    ebox.appendChild(a)
62
-  }
63
-
64
-  return event => {
65
-    if (!opened) {
66
-      event.target.parentElement.appendChild(ebox)
67
-
68
-      let f = e => {
69
-        event.target.nextSibling.remove()
70
-        opened = false
71
-        document.removeEventListener('click', f)
72
-      }
73
-
74
-      window.setTimeout(_ => document.addEventListener('click', f), 1)
75
-      opened = true
76
-    }
77
-  }
78
-  */
79
-}
80
-
81
-/**
82
- * BBEditor
83
- */
84
-function BBEditor(box) {
85
-  /*
86
-  // todo: Integrate BioJS functions here
87
-  if (box.previousSibling && box.previousSibling.className == 'bbcode_bar') return
88
-
89
-  let buttons = [
90
-    { short: 'B', name: 'Bold', wrap: ['[b]', '[/b]'] },
91
-    { short: 'I', name: 'Italic', wrap: ['[i]', '[/i]'] },
92
-    { short: 'U', name: 'Underline', wrap: ['[u]', '[/u]'] },
93
-    { short: 'S', name: 'Strikethrough', wrap: ['[s]', '[/s]'] },
94
-    { short: 'Left', name: 'Align Left', wrap: ['[align=left]', '[/align]'] },
95
-    { short: 'Center', name: 'Align Center', wrap: ['[align=center]', '[/align]'] },
96
-    { short: 'Right', name: 'Align Right', wrap: ['[align=right]', '[/align]'] },
97
-    { short: 'Pre', name: 'Preformatted', wrap: ['[pre]', '[/pre]'] },
98
-    { short: 'H1', name: 'Subheading 1', wrap: '==' },
99
-    { short: 'H2', name: 'Subheading 2', wrap: '===' },
100
-    { short: 'H3', name: 'Subheading 3', wrap: '====' },
101
-    { short: 'Color', name: 'Color', wrap: ['[color=]', '[/color]'], offset: 7 },
102
-    { short: 'TeX', name: 'LaTeX', wrap: ['[tex]', '[/tex]'] },
103
-    { short: 'Quote', name: 'Quote', wrap: ['[quote]', '[/quote]'] },
104
-    { short: 'List', name: 'List', wrap: ['[*]', ''] },
105
-    { short: 'Hide', name: 'Spoiler', wrap: ['[spoiler]', '[/spoiler]'] },
106
-    { short: 'Img', name: 'Image', wrap: ['[img]', '[/img]'] },
107
-    { short: 'Vid', name: 'Video', wrap: ['[embed]', '[/embed]'] },
108
-    { short: 'Link', name: 'Link', wrap: ['[url]', '[/url]'] },
109
-    { short: 'Torr', name: 'Torrent', wrap: ['[torrent]', '[/torrent]'] },
110
-    { short: '😃', name: 'Emoji', func: EmojiBox(box) }
111
-  ]
112
-
113
-  let bar = document.createElement('ul')
114
-  bar.className = "bbcode_bar"
115
-  bar.style.width = box.offsetWidth + 'px'
116
-
117
-  // Let the DOM update and then snap the size again (twice)
118
-  setTimeout(function () {
119
-    bar.style.width = box.offsetWidth + 'px'
120
-    bar.style.width = box.offsetWidth + 'px'
121
-  }, 1)
122
-
123
-  for (let button of buttons) {
124
-    li = document.createElement('li')
125
-    b = document.createElement('a')
126
-    b.setAttribute('title', button.name)
127
-    b.innerHTML = button.short
128
-
129
-    if (button.wrap) b.addEventListener('click', e => wrapSelected(box, button.wrap, button.offset))
130
-    else if (button.func) b.addEventListener('click', button.func)
131
-
132
-    li.appendChild(b)
133
-    bar.appendChild(li)
134
-  }
135
-  box.parentNode.insertBefore(bar, box)
136
-  */
137
-}
138
-
139
-$(function () {
140
-  $('.bbcode_editor').each((i, el) => BBEditor(el))
141
-  $(document).on('click', '.spoilerButton', e => BBSpoiler(e.target))
142
-})

+ 0
- 33
static/functions/donor_titles.js View File

@@ -1,33 +0,0 @@
1
-$(document).ready(function() {
2
-  if ($('#donor_title_prefix_preview').length === 0) {
3
-    return;
4
-  }
5
-  $('#donor_title_prefix_preview').text($('#donor_title_prefix').val().trim() + ' ');
6
-  $('#donor_title_suffix_preview').text(' ' + $('#donor_title_suffix').val().trim());
7
-
8
-  if ($('#donor_title_comma').attr('checked')) {
9
-    $('#donor_title_comma_preview').text('');
10
-  } else {
11
-    $('#donor_title_comma_preview').text(', ');
12
-  }
13
-
14
-  $('#donor_title_prefix').keyup(function() {
15
-    if ($(this).val().length <= 30) {
16
-      $('#donor_title_prefix_preview').text($(this).val().trim() + ' ');
17
-    }
18
-  });
19
-
20
-  $('#donor_title_suffix').keyup(function() {
21
-    if ($(this).val().length <= 30) {
22
-      $('#donor_title_suffix_preview').text(' ' + $(this).val().trim());
23
-    }
24
-  });
25
-
26
-  $('#donor_title_comma').change(function() {
27
-    if ($(this).attr('checked')) {
28
-      $('#donor_title_comma_preview').text('');
29
-    } else {
30
-      $('#donor_title_comma_preview').text(', ');
31
-    }
32
-  });
33
-});

+ 8
- 6
static/styles/bookish/scss/colors.scss View File

@@ -72,16 +72,18 @@ input[type="file"] {
72 72
 }
73 73
 
74 74
 .alertbar {
75
-    @include alertbar(silver);
76
-    /* @include alertbar($lb100); */
75
+    &.modbar {
76
+        @include alertbar(silver);
77
+        /* @include alertbar($lb100); */
78
+    }
77 79
 
78
-    .warning {
79
-        background: orange;
80
+    &.warning {
81
+        @include alertbar(orange);
80 82
         /* background: #ffe0b2; */
81 83
     }
82 84
 
83
-    .error {
84
-        background: red;
85
+    &.error {
86
+        @include alertbar(red);
85 87
         /* background: #ffcdd2; */
86 88
     }
87 89
 }

+ 8
- 0
static/styles/global/scss/fonts.scss View File

@@ -3,6 +3,14 @@ html {
3 3
     line-height: 1.6;
4 4
 }
5 5
 
6
+/* Wikipedia-style external links */
7
+a.external {
8
+    background-image: url(/static/common/symbols/external-link-ltr-icon.svg);
9
+    background-position: center right;
10
+    background-repeat: no-repeat;
11
+    padding-right: 13px;
12
+}
13
+
6 14
 /*
7 15
  * Spacing classes
8 16
  */

+ 38
- 0
templates/legal/about.html View File

@@ -0,0 +1,38 @@
1
+<h2>About BioTorrents.de</h2>
2
+
3
+<section class="tldr">
4
+  <p>
5
+    BioTorrents.de is a functional experiment in comfy data distribution.
6
+  </p>
7
+
8
+  <p>
9
+    It indexes a wide variety of biology data and serves it on a fast BitTorrent network.
10
+    The semantic website promotes organic content discovery and community annotations.
11
+    Other interfaces include a JSON API, RSS feeds, and IRC channels.
12
+  </p>
13
+
14
+  <p>
15
+    BioTorrents.de provides an open platform for disadvantaged researchers to host their data.
16
+    More importantly, it provides the necessary tools for others to find and cite it later.
17
+    It's a place for the Google Drives, FTP folders, and network shares that may not be accepted elsewhere.
18
+  </p>
19
+
20
+  <p>
21
+    A mature software product and draft publication are expected by Easter 2023.
22
+    Thank you for your curiosity, patience, and support as we grow the service.
23
+  </p>
24
+
25
+  <p>
26
+    <strong>
27
+      Email
28
+    </strong>
29
+    <br />
30
+    help at biotorrents dot de
31
+  </p>
32
+
33
+  <p>
34
+    Please use
35
+    <a href="/sections/legal/pubkey.txt">GPG A1D095A5DEC74A8B</a>
36
+    if you wish.
37
+  </p>
38
+</section>

+ 3
- 3
templates/legal/dmca.html View File

@@ -74,11 +74,11 @@
74 74
 
75 75
   <p>
76 76
     Remember that under
77
-    <a href="https://www.law.cornell.edu/uscode/text/17/512">17 USC 512(f)</a>,
77
+    <a class="external" href="https://www.law.cornell.edu/uscode/text/17/512">17 USC 512(f)</a>,
78 78
     anyone who knowingly materially misrepresents infringement may be subject to liability.
79 79
     Also see
80
-    <a href="https://www.law.cornell.edu/uscode/text/17/107">17 USC 107</a> and
81
-    <a href="https://www.law.cornell.edu/uscode/text/17/108">17 USC 108</a>.
80
+    <a class="external" href="https://www.law.cornell.edu/uscode/text/17/107">17 USC 107</a> and
81
+    <a class="external" href="https://www.law.cornell.edu/uscode/text/17/108">17 USC 108</a>.
82 82
   </p>
83 83
 
84 84
   <p>

+ 5
- 5
templates/legal/privacy.html View File

@@ -41,7 +41,7 @@
41 41
   <p>
42 42
     We don't collect cross-origin data.
43 43
     Also, we don't access
44
-    <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Feature-Policy#directives">browser features</a>
44
+    <a class="external" href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Feature-Policy#directives">browser features</a>
45 45
     such as camera, microphone, and sensors.
46 46
   </p>
47 47
 
@@ -102,11 +102,11 @@
102 102
   </h3>
103 103
 
104 104
   <p>
105
-    <a href="https://gdpr-info.eu/art-14-gdpr/">Art. 14 GDPR ¶ 5(a) and (b)</a>, and
106
-    <a href="https://gdpr-info.eu/art-27-gdpr/">Art. 27 ¶ 2</a> apply.
105
+    <a class="external" href="https://gdpr-info.eu/art-14-gdpr/">Art. 14 GDPR ¶ 5(a) and (b)</a>, and
106
+    <a class="external" href="https://gdpr-info.eu/art-27-gdpr/">Art. 27 ¶ 2</a> apply.
107 107
     Accordingly, we haven't designated an EU representative.
108 108
     Generally, we don't collect any personal data as defined in
109
-    <a href="https://gdpr-info.eu/art-4-gdpr/">Art. 4</a>
109
+    <a class="external" href="https://gdpr-info.eu/art-4-gdpr/">Art. 4</a>
110 110
     except what you voluntarily provide us.
111 111
   </p>
112 112
 
@@ -124,7 +124,7 @@
124 124
 
125 125
   <p>
126 126
     We're exempt from the California Consumer Privacy Act pursuant to
127
-    <a href="https://ccpa-info.com/home/1798-140-definitions/">CIV 1798.140(c)(1)(A)</a>.
127
+    <a class="external" href="https://ccpa-info.com/home/1798-140-definitions/">CIV 1798.140(c)(1)(A)</a>.
128 128
     Nonetheless, we'll be happy to delete your information
129 129
     to the extent you don't enter into a business relationship with us.
130 130
   </p>

+ 0
- 29
templates/staffblog/edit.twig View File

@@ -1,29 +0,0 @@
1
-<div class="box box2 thin">
2
-    <div class="head">
3
-        {{ verb|ucfirst }} a staff blog post
4
-        <span style="float: right;">
5
-            <a href="#" onclick="$('#postform').gtoggle(); this.innerHTML = (this.innerHTML == 'Hide' ? 'Show' : 'Hide'); return false;" class="brackets">{{
6
-                show_form ? 'Show' : 'Hide' }}</a>
7
-        </span>
8
-    </div>
9
-    <form class="{{ verb }}_form" name="blog_post" action="staffblog.php" method="post">
10
-        <div id="postform" class="pad{{ show_form ? ' hidden' : '' }}">
11
-            <input type="hidden" name="action" value="{{ verb == 'create' ? 'takenewblog' : 'takeeditblog' }}" />
12
-            <input type="hidden" name="auth" value="{{ auth }}" />
13
-{% if verb == 'edit' %}
14
-            <input type="hidden" name="blogid" value="{{ blog.blogId }}" />
15
-{% endif %}
16
-            <div class="field_div">
17
-                <h3>Title</h3>
18
-                <input type="text" name="title" size="95" value="{{ blog.title }}" />
19
-            </div>
20
-            <div class="field_div">
21
-                <h3>Body</h3>
22
-                <textarea name="body" cols="95" rows="15">{{ blog.body }}</textarea> <br />
23
-            </div>
24
-            <div class="submit_div center">
25
-                <input type="submit" value="{{ verb|ucfirst }} blog post" />
26
-            </div>
27
-        </div>
28
-    </form>
29
-</div>

+ 0
- 16
templates/staffblog/list.twig View File

@@ -1,16 +0,0 @@
1
-<div class="thin">
2
-{% for entry in list %}
3
-    <div id="blog{{ entry.id }}" class="box box2 blog_post">
4
-        <div class="head">
5
-            <strong>{{ entry.title }}</strong> - posted {{ entry.created|time_diff }} by {{ entry.author }}
6
-    {% if editor %}
7
-            - <a href="staffblog.php?action=editblog&amp;id={{ entry.id }}" class="brackets">Edit</a>
8
-            <a href="staffblog.php?action=deleteblog&amp;id={{ entry.id }}&amp;auth={{ auth }}" onclick="return confirm('Do you want to delete this?');" class="brackets">Delete</a>
9
-    {% endif %}
10
-        </div>
11
-        <div class="pad">
12
-            {{ entry.body|bb_format }}
13
-        </div>
14
-    </div>
15
-{% endfor %}
16
-</div>

Loading…
Cancel
Save