Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[serendipity_event_google_sitemap] notice for gmstrftime() and warning for isdraft #862

Open
bauigel opened this issue Jan 19, 2025 · 0 comments

Comments

@bauigel
Copy link

bauigel commented Jan 19, 2025

I get a lot of notices, when I save a static page and the plugin tries to update the sitemap.

Function gmstrftime() is deprecated in ./plugins/serendipity_event_google_sitemap/serendipity_event_google_sitemap.php on line 171

$str_lastmod = gmstrftime('%Y-%m-%dT%H:%M:%SZ', $lastmod); // 'Z' does mean UTC in W3C Date/Time

ChatGPT told me, that I could use this line:

$str_lastmod = (new DateTime('@' . $lastmod))->setTimezone(new DateTimeZone('UTC'))->format('Y-m-d\TH:i:s\Z');

The second thing is warning for isdraft in line 725

Warning: Undefined array key "isdraft" in ./plugins/serendipity_event_google_sitemap/serendipity_event_google_sitemap.php on line 725.

There has to be an isset added:

725 if (isset($eventData['isdraft']) && serendipity_db_bool($eventData['isdraft']) === false && $do_pingback && $cur_url) {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant