File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -139,18 +139,20 @@ public function OnWebhookUpdate() : bool
139139 $ Update = json_decode (file_get_contents ('php://input ' ));
140140 if (empty ($ Update ))
141141 {
142+ error_log ("Empty update " );
142143 http_response_code (400 );
143144 return false ;
144145 }
145146
146147 if ($ this ->Settings ->AutoHandleDuplicateUpdates )
147148 {
148149 # If sooner than 2 weeks
149- if ($ this ->Settings ->LastUpdateDate < strtotime ('-2 week ' ))
150+ if ($ this ->Settings ->LastUpdateDate > strtotime ('-2 week ' ))
150151 {
151152 if ($ this ->Settings ->LastUpdateID >= $ Update ->update_id )
152153 {
153154 // This update is fake or duplicate by ID
155+ error_log ("Last update ID ( {$ this ->Settings ->LastUpdateID }) >= Receieved update ID ( {$ Update ->update_id }) " );
154156 http_response_code (400 );
155157 return false ;
156158 }
@@ -165,6 +167,7 @@ public function OnWebhookUpdate() : bool
165167 if ($ _GET ['token_hash ' ] != hash ($ this ->HashingMethod , $ this ->Token ))
166168 {
167169 # Fake update
170+ error_log ("Unauthorized, Received token_hash= {$ _GET ['token_hash ' ]}" );
168171 http_response_code (401 );
169172 return false ;
170173 }
You can’t perform that action at this time.
0 commit comments