rspec/rules/S5167/php/rule.adoc
2022-02-04 16:28:24 +00:00

35 lines
539 B
Plaintext

include::../description.adoc[]
== Noncompliant Code Example
[source,php]
----
$value = $_GET["value"];
header("X-Header: $value"); // Noncompliant
----
== Compliant Solution
[source,php]
----
$value = $_GET["value"];
if (ctype_alnum($value)) {
header("X-Header: $value"); // Compliant
} else {
// Error
}
----
include::../see.adoc[]
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::../message.adoc[]
include::../highlighting.adoc[]
endif::env-github,rspecator-view[]