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

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

Closed
jamesmacwhite opened this issue Mar 14, 2024 · 3 comments
Labels

Comments

@jamesmacwhite
Copy link

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

  • Plugin version: 3.4.73
  • Craft version: 3.9.11
@jamesmacwhite
Copy link
Author

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 added a commit that referenced this issue Mar 15, 2024
khalwat added a commit that referenced this issue Mar 15, 2024
khalwat added a commit that referenced this issue Mar 15, 2024
@khalwat
Copy link
Collaborator

khalwat commented Mar 15, 2024

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

@khalwat khalwat closed this as completed Mar 15, 2024
@jamesmacwhite
Copy link
Author

Awesome, thank you!

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

No branches or pull requests

2 participants