Skip to content

Commit

Permalink
Update Create.php
Browse files Browse the repository at this point in the history
Ensure reserved key comparison is not case sensitive
  • Loading branch information
smg6511 authored and opengeek committed Feb 16, 2024
1 parent f761630 commit 4f58af1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/src/Revolution/Processors/Context/Create.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public function beforeSave()
case empty($key):
$this->addFieldError('key', $this->modx->lexicon('context_err_ns_key'));
break;

Check warning on line 42 in core/src/Revolution/Processors/Context/Create.php

View check run for this annotation

Codecov / codecov/patch

core/src/Revolution/Processors/Context/Create.php#L41-L42

Added lines #L41 - L42 were not covered by tests
case in_array($key, $this->classKey::RESERVED_KEYS):
case in_array(strtolower($key), $this->classKey::RESERVED_KEYS):
$this->addFieldError('key', $this->modx->lexicon('context_err_reserved'));
break;

Check warning on line 45 in core/src/Revolution/Processors/Context/Create.php

View check run for this annotation

Codecov / codecov/patch

core/src/Revolution/Processors/Context/Create.php#L44-L45

Added lines #L44 - L45 were not covered by tests
case $this->alreadyExists($key):
Expand Down

0 comments on commit 4f58af1

Please sign in to comment.