Skip to content

ENHANCEMENT Validate against missing block division #27

Open
@tractorcow

Description

@tractorcow

E.g. in this config

---
Name: myemailconfig
After:
  - '#emailconfig'
SilverStripe\Core\Injector\Injector:
  Swift_Transport:
    class: Swift_SmtpTransport
    properties:
      Host: mail.example.com
      Port: 587
      Encryption: null
    calls:
      Username: [ setUsername, ['[email protected]'] ]
      Password: [ setPassword, ['123456'] ]
      AuthMode: [ setAuthMode, ['login'] ]

The missing --- on the block header groups this entire file inside the header (with no body) and thus acts as a blank config block. However, no error is raised.

We should raise a warning if an unsupported header key is presented, with a whitelist of allowed keys (e.g. name, only, after, before, except).

Noted in silverstripe/silverstripe-framework#7700 (comment)

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions