Skip to content

Commit 76587c4

Browse files
committed
Ruby: fix capitalisation of String in qhelp
1 parent 468c718 commit 76587c4

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

ruby/ql/src/queries/security/cwe-116/IncompleteSanitization.qhelp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ injection or cross-site scripting. Usually, this is done by escaping meta-charac
1010
in a domain-specific way so that they are treated as normal characters.
1111
</p>
1212
<p>
13-
However, directly using the <code>string#sub</code> method to perform escaping is notoriously
13+
However, directly using the <code>String#sub</code> method to perform escaping is notoriously
1414
error-prone. Common mistakes include only replacing the first occurrence of a meta-character, or
1515
backslash-escaping various meta-characters but not the backslash itself.
1616
</p>
@@ -34,12 +34,12 @@ handle corner cases correctly than a custom implementation.
3434

3535
<p>
3636
An even safer alternative is to design the application so that sanitization is not needed.
37-
Otherwise, make sure to use <code>string#gsub</code> rather than <code>string#sub</code>, to ensure
37+
Otherwise, make sure to use <code>String#gsub</code> rather than <code>String#sub</code>, to ensure
3838
that all occurrences are replaced, and remember to escape backslashes if applicable.
3939
</p>
4040
<p>
4141
Note, however, that this is generally <i>not</i> sufficient for replacing multi-character strings:
42-
the <code>string#gsub</code> method performs only one pass over the input string, and will not
42+
the <code>String#gsub</code> method performs only one pass over the input string, and will not
4343
replace further instances of the string that result from earlier replacements.
4444
</p>
4545
<p>
@@ -62,7 +62,7 @@ doubling single quotes, and thereby escaping them:
6262
<sample src="examples/IncompleteSanitization.rb" />
6363

6464
<p>
65-
As written, this sanitizer is ineffective: <code>string#sub</code> will replace only the
65+
As written, this sanitizer is ineffective: <code>String#sub</code> will replace only the
6666
<i>first</i> occurrence of that string.
6767
</p>
6868

@@ -74,7 +74,7 @@ that automatically sanitize parameters.
7474

7575
<p>
7676
If this is not an option, <code>escape_quotes</code> should be rewritten to use the
77-
<code>string#gsub</code> method instead:
77+
<code>String#gsub</code> method instead:
7878
</p>
7979

8080
<sample src="examples/IncompleteSanitizationGood.rb" />

0 commit comments

Comments
 (0)