@@ -24,8 +24,7 @@ |
||
| 24 | 24 | $dateString = $date->format('Y-m-d H:i:s'); |
| 25 | 25 | |
| 26 | 26 | return $dateString; |
| 27 | - } |
|
| 28 | - else { |
|
| 27 | + } else { |
|
| 29 | 28 | return $input; |
| 30 | 29 | } |
| 31 | 30 | } |
| 32 | 31 | \ No newline at end of file |
@@ -22,8 +22,7 @@ discard block |
||
| 22 | 22 | && (get_class($input) === DateTime::class || get_class($input) === DateTimeImmutable::class) |
| 23 | 23 | ) { |
| 24 | 24 | $then = $input; |
| 25 | - } |
|
| 26 | - else { |
|
| 25 | + } else { |
|
| 27 | 26 | $then = new DateTime($input); |
| 28 | 27 | } |
| 29 | 28 | |
@@ -48,29 +47,21 @@ discard block |
||
| 48 | 47 | if ($secs <= 10) { |
| 49 | 48 | $output = "just now"; |
| 50 | 49 | $pluralise = false; |
| 51 | - } |
|
| 52 | - elseif ($secs > 10 && $secs < $minuteCut) { |
|
| 50 | + } elseif ($secs > 10 && $secs < $minuteCut) { |
|
| 53 | 51 | $output = round($secs / $second) . " second"; |
| 54 | - } |
|
| 55 | - elseif ($secs >= $minuteCut && $secs < $hourCut) { |
|
| 52 | + } elseif ($secs >= $minuteCut && $secs < $hourCut) { |
|
| 56 | 53 | $output = round($secs / $minute) . " minute"; |
| 57 | - } |
|
| 58 | - elseif ($secs >= $hourCut && $secs < $dayCut) { |
|
| 54 | + } elseif ($secs >= $hourCut && $secs < $dayCut) { |
|
| 59 | 55 | $output = round($secs / $hour) . " hour"; |
| 60 | - } |
|
| 61 | - elseif ($secs >= $dayCut && $secs < $weekCut) { |
|
| 56 | + } elseif ($secs >= $dayCut && $secs < $weekCut) { |
|
| 62 | 57 | $output = round($secs / $day) . " day"; |
| 63 | - } |
|
| 64 | - elseif ($secs >= $weekCut && $secs < $monthCut) { |
|
| 58 | + } elseif ($secs >= $weekCut && $secs < $monthCut) { |
|
| 65 | 59 | $output = round($secs / $week) . " week"; |
| 66 | - } |
|
| 67 | - elseif ($secs >= $monthCut && $secs < $yearCut) { |
|
| 60 | + } elseif ($secs >= $monthCut && $secs < $yearCut) { |
|
| 68 | 61 | $output = round($secs / $month) . " month"; |
| 69 | - } |
|
| 70 | - elseif ($secs >= $yearCut && $secs < $year * 10) { |
|
| 62 | + } elseif ($secs >= $yearCut && $secs < $year * 10) { |
|
| 71 | 63 | $output = round($secs / $year) . " year"; |
| 72 | - } |
|
| 73 | - else { |
|
| 64 | + } else { |
|
| 74 | 65 | $output = "a long time ago"; |
| 75 | 66 | $pluralise = false; |
| 76 | 67 | } |
@@ -37,13 +37,11 @@ |
||
| 37 | 37 | echo 'Error resolving hostname, it doesn\'t look like this domain exists.'; |
| 38 | 38 | die(); |
| 39 | 39 | } |
| 40 | - } |
|
| 41 | - else { |
|
| 40 | + } else { |
|
| 42 | 41 | $data = htmlentities($data, ENT_COMPAT, 'UTF-8'); |
| 43 | 42 | } |
| 44 | 43 | |
| 45 | 44 | echo '<script>window.location.href="' . str_replace("%DATA%", $data, $toolList[$tool]) . '"</script>'; |
| 46 | -} |
|
| 47 | -else { |
|
| 45 | +} else { |
|
| 48 | 46 | header("Location: " . $_SERVER["REQUEST_URI"] . "&round2=true"); |
| 49 | 47 | } |