Marco Borgeaud 6550e65756
Diff blocks: fix some incorrect use for php (#2804)
Improvement identified in #2790.

Add a prefix to the diff-id when it is used multiple times in different
"how to fix it in XYZ" sections to avoid ambiguity and pedantically
follow the spec:

> A single and unique diff-id should be used only once for each type of
code example as shown in the description of a rule.

Obvious typos around `diff-type` were fixed.
2023-08-10 15:57:24 +02:00

37 lines
797 B
Plaintext

== How to fix it in cURL
=== Code examples
include::../../common/fix/code-rationale.adoc[]
:cert_variable_name: CURLOPT_SSL_VERIFYPEER
:cert_variable_unsafe_value: false
:cert_variable_safe_value: true
include::../../common/fix/code-rationale-setting.adoc[]
==== Noncompliant code example
[source,php,diff-id=1,diff-type=noncompliant]
----
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'https://example.com/');
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); // Noncompliant
curl_exec($curl);
curl_close($curl);
----
==== Compliant solution
[source,php,diff-id=1,diff-type=compliant]
----
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'https://example.com/');
curl_exec($curl);
curl_close($curl);
----
=== How does this work?
include::../../common/fix/validation.adoc[]