6 Commits

Author SHA1 Message Date
  spaghetti 7f7fa62a79 Something about overflow I dunno this one doesn't have a commit message in the internal repo 7 years ago
  spaghetti 59b2333bcf Don't leak anonymous uploads' uploaders through RSS 7 years ago
  spaghetti a5c5951cfa Fix old default torrent search code that would corrupt user settings 7 years ago
  spaghetti fbf77bcf54 That doesn't even make sense 7 years ago
  spaghetti 6a6905d32e ban IPv6 IPs correctly too 7 years ago
  spaghetti 5cb51c8fa9 PHP is strict about this now 7 years ago

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

45
 define("PARANOIA_ALLOWED", 1);
45
 define("PARANOIA_ALLOWED", 1);
46
 define("PARANOIA_OVERRIDDEN", 2);
46
 define("PARANOIA_OVERRIDDEN", 2);
47
 
47
 
48
-function check_paranoia($Property, $Paranoia, $UserClass, $UserID = false) {
48
+function check_paranoia($Property, $Paranoia = false, $UserClass = false, $UserID = false) {
49
   global $Classes;
49
   global $Classes;
50
   if ($Property == false) {
50
   if ($Property == false) {
51
     return false;
51
     return false;

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

7
    */
7
    */
8
   public static function site_ban_ip($IP) {
8
   public static function site_ban_ip($IP) {
9
     global $Debug;
9
     global $Debug;
10
-    $A = substr($IP, 0, strcspn($IP, '.'));
10
+    $A = substr($IP, 0, strcspn($IP, '.:'));
11
     $IPNum = Tools::ip_to_unsigned($IP);
11
     $IPNum = Tools::ip_to_unsigned($IP);
12
     $IPBans = G::$Cache->get_value('ip_bans_'.$A);
12
     $IPBans = G::$Cache->get_value('ip_bans_'.$A);
13
     if (!is_array($IPBans)) {
13
     if (!is_array($IPBans)) {

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

18
   $Cache->cache_value('news_latest_title', $News[0][1], 0);
18
   $Cache->cache_value('news_latest_title', $News[0][1], 0);
19
 }
19
 }
20
 
20
 
21
-if ($LoggedUser['LastReadNews'] != $News[0][0] && count($News[0][0]) > 0) {
21
+if ($LoggedUser['LastReadNews'] != $News[0][0] && count($News) > 0) {
22
   $Cache->begin_transaction("user_info_heavy_$UserID");
22
   $Cache->begin_transaction("user_info_heavy_$UserID");
23
   $Cache->update_row(false, array('LastReadNews' => $News[0][0]));
23
   $Cache->update_row(false, array('LastReadNews' => $News[0][0]));
24
   $Cache->commit_transaction(0);
24
   $Cache->commit_transaction(0);

+ 8
- 12
sections/torrents/browse.php View File

47
   $DB->query("
47
   $DB->query("
48
     SELECT SiteOptions
48
     SELECT SiteOptions
49
     FROM users_info
49
     FROM users_info
50
-    WHERE UserID = '".db_string($LoggedUser['ID'])."'");
50
+    WHERE UserID = ?", $LoggedUser['ID']);
51
   list($SiteOptions) = $DB->next_record(MYSQLI_NUM, false);
51
   list($SiteOptions) = $DB->next_record(MYSQLI_NUM, false);
52
-  if (!empty($SiteOptions)) {
53
-    $SiteOptions = unserialize($SiteOptions);
54
-  } else {
55
-    $SiteOptions = [];
56
-  }
52
+  $SiteOptions = json_decode($SiteOptions, true) ?? [];
57
   $SiteOptions['DefaultSearch'] = preg_replace($UnsetRegexp, '', $_SERVER['QUERY_STRING']);
53
   $SiteOptions['DefaultSearch'] = preg_replace($UnsetRegexp, '', $_SERVER['QUERY_STRING']);
58
   $DB->query("
54
   $DB->query("
59
     UPDATE users_info
55
     UPDATE users_info
60
-    SET SiteOptions = '".db_string(serialize($SiteOptions))."'
61
-    WHERE UserID = '".db_string($LoggedUser['ID'])."'");
56
+    SET SiteOptions = ?
57
+    WHERE UserID = ?", json_encode($SiteOptions), $LoggedUser['ID']);
62
   $Cache->begin_transaction("user_info_heavy_$UserID");
58
   $Cache->begin_transaction("user_info_heavy_$UserID");
63
   $Cache->update_row(false, ['DefaultSearch' => $SiteOptions['DefaultSearch']]);
59
   $Cache->update_row(false, ['DefaultSearch' => $SiteOptions['DefaultSearch']]);
64
   $Cache->commit_transaction(0);
60
   $Cache->commit_transaction(0);
68
   $DB->query("
64
   $DB->query("
69
     SELECT SiteOptions
65
     SELECT SiteOptions
70
     FROM users_info
66
     FROM users_info
71
-    WHERE UserID = '".db_string($LoggedUser['ID'])."'");
67
+    WHERE UserID = ?", $LoggedUser['ID']);
72
   list($SiteOptions) = $DB->next_record(MYSQLI_NUM, false);
68
   list($SiteOptions) = $DB->next_record(MYSQLI_NUM, false);
73
-  $SiteOptions = unserialize($SiteOptions);
69
+  $SiteOptions = json_decode($SiteOptions, true) ?? [];
74
   $SiteOptions['DefaultSearch'] = '';
70
   $SiteOptions['DefaultSearch'] = '';
75
   $DB->query("
71
   $DB->query("
76
     UPDATE users_info
72
     UPDATE users_info
77
-    SET SiteOptions = '".db_string(serialize($SiteOptions))."'
78
-    WHERE UserID = '".db_string($LoggedUser['ID'])."'");
73
+    SET SiteOptions = ?
74
+    WHERE UserID = ?", json_encode($SiteOptions), $LoggedUser['ID']);
79
   $Cache->begin_transaction("user_info_heavy_$UserID");
75
   $Cache->begin_transaction("user_info_heavy_$UserID");
80
   $Cache->update_row(false, ['DefaultSearch' => '']);
76
   $Cache->update_row(false, ['DefaultSearch' => '']);
81
   $Cache->commit_transaction(0);
77
   $Cache->commit_transaction(0);

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

660
 // Manage notifications
660
 // Manage notifications
661
 
661
 
662
 // For RSS
662
 // For RSS
663
-$Item = $Feed->item($Title, Text::strip_bbcode($Body), 'torrents.php?action=download&authkey=[[AUTHKEY]]&torrent_pass=[[PASSKEY]]&id='.$TorrentID, $LoggedUser['Username'], 'torrents.php?id='.$GroupID, trim($T['TagList']));
663
+$Item = $Feed->item($Title, Text::strip_bbcode($Body), 'torrents.php?action=download&authkey=[[AUTHKEY]]&torrent_pass=[[PASSKEY]]&id='.$TorrentID, $Properties['Anonymous'] ? 'Anonymous' : $LoggedUser['Username'], 'torrents.php?id='.$GroupID, trim($T['TagList']));
664
 
664
 
665
 
665
 
666
 //Notifications
666
 //Notifications

+ 4
- 0
static/styles/global.css View File

645
   margin-right: 2px;
645
   margin-right: 2px;
646
 }
646
 }
647
 
647
 
648
+.forum_post blockquote {
649
+  overflow-x: auto;
650
+}
651
+
648
 .donor_icon {
652
 .donor_icon {
649
   margin-left: 2px;
653
   margin-left: 2px;
650
   margin-right: 2px;
654
   margin-right: 2px;

Loading…
Cancel
Save