rspec/rules/S1600/php/rule.adoc

43 lines
680 B
Plaintext
Raw Normal View History

2021-04-28 16:49:39 +02:00
The following predefined variables are deprecated and should be replaced by the new versions:
||Replace||With||
|$HTTP_SERVER_VARS|$_SERVER|
|$HTTP_GET_VARS|$_GET|
|$HTTP_POST_VARS|$_POST|
|$HTTP_POST_FILES|$_FILES|
|$HTTP_SESSION_VARS|$_SESSION|
|$HTTP_ENV_VARS|$_ENV|
|$HTTP_COOKIE_VARS|$_COOKIE|
|$php_errormsg|error_get_last()|
2021-04-28 16:49:39 +02:00
== Noncompliant Code Example
----
echo 'Name parameter value: ' . $HTTP_GET_VARS["name"];
----
2021-04-28 16:49:39 +02:00
== Compliant Solution
----
echo 'Name parameter value: ' . $_GET["name"];
----
ifdef::env-github,rspecator-view[]
== Comments And Links
(visible only on this page)
include::comments-and-links.adoc[]
endif::env-github,rspecator-view[]