nystudio107 / craft-seomatic

SEOmatic facilitates modern SEO best practices & implementation for Craft CMS 3. It is a turnkey SEO system that is comprehensive, powerful, and flexible.
https://nystudio107.com/plugins/seomatic
Other
162 stars 68 forks source link

security.txt: str_ends_with(): Argument #1 ($haystack) must be of type string, array given #1435

Closed jamesmacwhite closed 3 months ago

jamesmacwhite commented 3 months ago

Describe the bug

To comply with the RFC for security.txt https://www.rfc-editor.org/rfc/rfc9116#section-2.2 the security.txt

Every line MUST end with either a carriage return and line feed characters (CRLF / %x0D %x0A) or just a line feed character (LF / %x0A).

If I try and add a new line and save the field a PHP error is thrown.

To reproduce

Steps to reproduce the behaviour:

  1. Go to seomatic/global/security/default
  2. Edit the security.txt template with a new line and save
  3. PHP error is thrown as described.

Expected behaviour

The security.txt template to be saved without error.

Versions

jamesmacwhite commented 3 months ago

It would appear I cannot save the security.txt template with any content, regardless of the value of the field. It is unrelated to the new line feed/enter of a new line, the value being blank also causes this error. It just so happens we had a report of non-compliance to the RFC which I tested with, but have since discovered the issue.

khalwat commented 3 months ago

Fixed in the just released versions: 3.4.74, 4.0.44, and 5.0.0-beta.7

jamesmacwhite commented 3 months ago

Awesome, thank you!