rspec/rules/S5167/php/rule.adoc

22 lines
316 B
Plaintext
Raw Normal View History

2020-06-30 12:50:28 +02:00
include::../description.adoc[]
== Noncompliant Code Example
----
$value = $_GET["value"];
header("X-Header: $value"); // Noncompliant
----
== Compliant Solution
----
$value = $_GET["value"];
if (ctype_alnum($value)) {
header("X-Header: $value"); // Compliant
} else {
// Error
}
----
include::../see.adoc[]