Skip to content

Bug: cron field order wrong in weathermap_check_cron() — DOM/month/DOW swapped #208

@somethingwithproof

Description

@somethingwithproof

Summary

In lib/poller-common.php, weathermap_check_cron() parses the cron schedule with the wrong field order:

[$minute, $hour, $wday, $day, $month] = preg_split('/\s+/', $string);

Standard crontab field order is minute hour dom month dow. This code assigns field[2] to $wday (day of week), field[3] to $day (day of month), and field[4] to $month. The correct assignment should be:

[$minute, $hour, $day, $month, $wday] = preg_split('/\s+/', $string);

Impact

A schedule of 0 2 * * 1 (Mondays at 02:00) is parsed as minute=0, hour=2, wday=*, day=*, month=1, causing the map to run every hour in January instead of Mondays at 2am. Purely silent; no error is thrown.

Priority

Silent logic bug. Queue for Friday.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions