You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: includes/components/report.class.php
+24-3Lines changed: 24 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -144,11 +144,11 @@ public function __construct(private int $mode, private int $reason, private ?int
144
144
$this->subject ??= 0; // 0 for utility, tools and misc pages?
145
145
}
146
146
147
-
privatefunctioncheckTargetContext() : int
147
+
privatefunctioncheckTargetContext(?string$url) : int
148
148
{
149
149
// check already reported
150
150
$field = User::isLoggedIn() ? 'userId' : 'ip';
151
-
if (DB::Aowow()->selectCell('SELECT 1 FROM ?_reports WHERE `mode` = ?d AND `reason`= ?d AND `subject` = ?d AND ?# = ?', $this->mode, $this->reason, $this->subject, $field, User::$id ?: User::$ip))
151
+
if (DB::Aowow()->selectCell('SELECT 1 FROM ?_reports WHERE `mode` = ?d AND `reason`= ?d AND `subject` = ?d{ AND `url` = ?} AND ?# = ?', $this->mode, $this->reason, $this->subject, $url ?: DBSIMPLE_SKIP, $field, User::$id ?: User::$ip))
152
152
returnself::ERR_ALREADY_REPORTED;
153
153
154
154
// check targeted post/postOwner staff status
@@ -190,7 +190,28 @@ public function create(string $desc, ?string $userAgent = null, ?string $appName
190
190
returnfalse;
191
191
}
192
192
193
-
if($err = $this->checkTargetContext())
193
+
// clean up src url: dont use anchors, clean up query
0 commit comments