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

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

Open
ghost opened this issue May 24, 2019 · 0 comments

Comments

@ghost
Copy link

ghost commented May 24, 2019

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.

@ghost ghost changed the title [data/C/books-and-ebooks/0002-fedora-defensive-coding.json] date field isn't applied from the JSON file to the README.me [data/C/books-and-ebooks/0002-fedora-defensive-coding.json] date field isn't applied from the JSON file to the README.md May 24, 2019
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

0 participants