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,7 +45,7 @@
45 45
 define("PARANOIA_ALLOWED", 1);
46 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 49
   global $Classes;
50 50
   if ($Property == false) {
51 51
     return false;

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

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

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

@@ -18,7 +18,7 @@ if (!$News = $Cache->get_value('news')) {
18 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 22
   $Cache->begin_transaction("user_info_heavy_$UserID");
23 23
   $Cache->update_row(false, array('LastReadNews' => $News[0][0]));
24 24
   $Cache->commit_transaction(0);

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

@@ -47,18 +47,14 @@ if (!empty($_GET['setdefault'])) {
47 47
   $DB->query("
48 48
     SELECT SiteOptions
49 49
     FROM users_info
50
-    WHERE UserID = '".db_string($LoggedUser['ID'])."'");
50
+    WHERE UserID = ?", $LoggedUser['ID']);
51 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 53
   $SiteOptions['DefaultSearch'] = preg_replace($UnsetRegexp, '', $_SERVER['QUERY_STRING']);
58 54
   $DB->query("
59 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 58
   $Cache->begin_transaction("user_info_heavy_$UserID");
63 59
   $Cache->update_row(false, ['DefaultSearch' => $SiteOptions['DefaultSearch']]);
64 60
   $Cache->commit_transaction(0);
@@ -68,14 +64,14 @@ if (!empty($_GET['setdefault'])) {
68 64
   $DB->query("
69 65
     SELECT SiteOptions
70 66
     FROM users_info
71
-    WHERE UserID = '".db_string($LoggedUser['ID'])."'");
67
+    WHERE UserID = ?", $LoggedUser['ID']);
72 68
   list($SiteOptions) = $DB->next_record(MYSQLI_NUM, false);
73
-  $SiteOptions = unserialize($SiteOptions);
69
+  $SiteOptions = json_decode($SiteOptions, true) ?? [];
74 70
   $SiteOptions['DefaultSearch'] = '';
75 71
   $DB->query("
76 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 75
   $Cache->begin_transaction("user_info_heavy_$UserID");
80 76
   $Cache->update_row(false, ['DefaultSearch' => '']);
81 77
   $Cache->commit_transaction(0);

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

@@ -660,7 +660,7 @@ $Debug->set_flag('upload: announced on irc');
660 660
 // Manage notifications
661 661
 
662 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 666
 //Notifications

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

@@ -645,6 +645,10 @@ tr.torrent .bookmark>a:after {
645 645
   margin-right: 2px;
646 646
 }
647 647
 
648
+.forum_post blockquote {
649
+  overflow-x: auto;
650
+}
651
+
648 652
 .donor_icon {
649 653
   margin-left: 2px;
650 654
   margin-right: 2px;

Loading…
Cancel
Save