Skip to content

Commit

Permalink
bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
albertoleoncio committed Apr 10, 2023
1 parent a112565 commit ac06f1d
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions blockrequest.php
Expand Up @@ -174,13 +174,19 @@ private function requestTimestamp($code)
$timestamp
);

$y = $timestamp['5']['0'];
$y = sprintf("%04d", $timestamp['5']['0']);
$m = $this->convertMonthNameToNumber($timestamp['4']['0']);
$d = $timestamp['3']['0'];
$h = $timestamp['2']['0'];
$i = $timestamp['1']['0'];
$d = sprintf("%02d", $timestamp['3']['0']);
$h = sprintf("%02d", $timestamp['1']['0']);
$i = sprintf("%02d", $timestamp['2']['0']);

return strtotime("{$y}-{$m}-{$d}T{$h}:{$i}:00Z");
$time = strtotime("{$y}-{$m}-{$d}T{$h}:{$i}:00Z");

if (!$time) {
throw new UnexpectedValueException("Error converting {$y}-{$m}-{$d}T{$h}:{$i}:00Z");
}

return $time;
}

/**
Expand Down Expand Up @@ -326,7 +332,7 @@ private function processBlockingSection($text, $section, $page)
private function processProtectingSection($text, $section, $page)
{
$protectLog = $this->getProtectionInfo($this->getSectionTitle($text));
if ($protectLog && $this->requestTimestamp($text) > $protectLog['timestamp']) {
if ($protectLog && $this->requestTimestamp($text) < $protectLog['timestamp']) {
echo " e já finalizada. Fechando...";
$text = $this->replaceInitialSection($text);
$text = $this->replaceFinalProtectSection($text, $protectLog);
Expand Down

0 comments on commit ac06f1d

Please sign in to comment.