diff options
author | Mario Vavti <mario@mariovavti.com> | 2025-04-18 22:38:45 +0200 |
---|---|---|
committer | Mario Vavti <mario@mariovavti.com> | 2025-04-18 22:38:45 +0200 |
commit | cace4c6c65438cc90efb51ec3098df715c194f31 (patch) | |
tree | e7a49a63077085565c077aecafd08671fa50ec1a | |
parent | d7aff9a4dd30a624a724edd638e41cf66add9b6b (diff) | |
download | volse-hubzilla-cace4c6c65438cc90efb51ec3098df715c194f31.tar.gz volse-hubzilla-cace4c6c65438cc90efb51ec3098df715c194f31.tar.bz2 volse-hubzilla-cace4c6c65438cc90efb51ec3098df715c194f31.zip |
strtotime() accounts with the timezone - set it to UTC for the stored timestamp
-rw-r--r-- | Zotlabs/Lib/MessageFilter.php | 4 | ||||
-rw-r--r-- | tests/unit/Lib/MessageFilterTest.php | 3 | ||||
-rw-r--r-- | vendor/composer/installed.php | 4 |
3 files changed, 7 insertions, 4 deletions
diff --git a/Zotlabs/Lib/MessageFilter.php b/Zotlabs/Lib/MessageFilter.php index da7181f78..fa3d61244 100644 --- a/Zotlabs/Lib/MessageFilter.php +++ b/Zotlabs/Lib/MessageFilter.php @@ -44,7 +44,7 @@ class MessageFilter { } elseif (str_starts_with($word, 'until=')) { $until = strtotime(trim(substr($word, 6))); - if ($until > strtotime($item['created'])) { + if ($until > strtotime($item['created'] . ' UTC')) { return false; } } @@ -98,7 +98,7 @@ class MessageFilter { } elseif (str_starts_with($word, 'until=')) { $until = strtotime(trim(substr($word, 6))); - if ($until > strtotime($item['created'])) { + if ($until > strtotime($item['created'] . ' UTC')) { return true; } } diff --git a/tests/unit/Lib/MessageFilterTest.php b/tests/unit/Lib/MessageFilterTest.php index e1b6d8476..0a2aea0c6 100644 --- a/tests/unit/Lib/MessageFilterTest.php +++ b/tests/unit/Lib/MessageFilterTest.php @@ -12,6 +12,9 @@ class MessageFilterTest extends UnitTestCase { * @dataProvider evaluate_provider */ public function test_evaluate(string $incl, string $excl, bool $result) : void { + // This is for simpler handling of the timestamps + date_default_timezone_set('UTC'); + $item = [ 'title' => '', 'body' => "A grasshopper spent the summer hopping about in the sun and singing to his heart's content. One day, an ant went hurrying by, looking very hot and weary.\r\n#story #grasshopper #ant", diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php index f96718034..23f2c94a9 100644 --- a/vendor/composer/installed.php +++ b/vendor/composer/installed.php @@ -3,7 +3,7 @@ 'name' => 'zotlabs/hubzilla', 'pretty_version' => 'dev-10.2RC', 'version' => 'dev-10.2RC', - 'reference' => 'a4a7794315538fc840cc002f9823fd8107d345bd', + 'reference' => 'd7aff9a4dd30a624a724edd638e41cf66add9b6b', 'type' => 'application', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), @@ -430,7 +430,7 @@ 'zotlabs/hubzilla' => array( 'pretty_version' => 'dev-10.2RC', 'version' => 'dev-10.2RC', - 'reference' => 'a4a7794315538fc840cc002f9823fd8107d345bd', + 'reference' => 'd7aff9a4dd30a624a724edd638e41cf66add9b6b', 'type' => 'application', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), |