Skip to content

[data/C/books-and-ebooks/0002-fedora-defensive-coding.json] date field isn't applied from the JSON file to the README.md #52

@ghost

Description

After running src/compiler.php the date is ignored:

$ grep -r date data/C/books-and-ebooks/0002-fedora-defensive-coding.json 
    "date": "2012",
  • README.md:
-      * [Defensive Coding: A Guide to Improving Software Security by the Fedora Security Team](#defensive-coding-a-guide-to-improving-software-security-by-the-fedora-security-team-2018) (2018)
+      * [Defensive Coding: A Guide to Improving Software Security by the Fedora Security Team](#defensive-coding-a-guide-to-improving-software-security-by-the-fedora-security-team-2019) (2019)
  • src/Util.php:
        if (!empty($fd['date'])) {
            $dt = new \DateTime($fd['date']);
            $header .= ' ('.$dt->format('Y').')';
        }

Instead of just using the year, it seems working when date matches the pattern "YYYY-MM"

https://github.com/paragonie/awesome-appsec/blob/master/data/C/books-and-ebooks/0002-fedora-defensive-coding.json#L2

  • Notes:

OK: Four digit year and month (GNU) YY "-" mm "2008-6", "2008-06", "1978-12"
NOK: Year (and just the year) YY "1978", "2008"
https://www.php.net/manual/pt_BR/datetime.construct.php#123882
https://www.php.net/manual/pt_BR/datetime.construct.php#119591
https://www.php.net/manual/en/datetime.formats.date.php)

Include optional fields and examples.

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