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

26 lines
570 B
Plaintext

== How to fix it in OpenSSL
=== Code examples
==== Noncompliant code example
include::../../common/fix/aes-noncompliant-example.adoc[]
[source,php,diff-id=11,diff-type=noncompliant]
----
openssl_encrypt($plaintext, "BF-ECB", $key, $options=OPENSSL_RAW_DATA, $iv); // Noncompliant
----
==== Compliant solution
include::../../common/fix/aes-compliant-example.adoc[]
[source,php,diff-id=11,diff-type=compliant]
----
openssl_encrypt($plaintext, "aes-256-gcm", $key, $options=OPENSSL_RAW_DATA, $iv);
----
=== How does this work?
include::../../common/fix/fix.adoc[]