53 lines
989 B
Plaintext
53 lines
989 B
Plaintext
![]() |
include::../description.adoc[]
|
|||
|
|
|||
|
include::../ask-yourself.adoc[]
|
|||
|
|
|||
|
include::../recommended.adoc[]
|
|||
|
|
|||
|
== Sensitive Code Example
|
|||
|
|
|||
|
A hidden BIDI character is present in front of `return`:
|
|||
|
|
|||
|
----
|
|||
|
def subtract_funds(account: str, amount: int):
|
|||
|
''' Subtract funds from bank account then ''' ;return
|
|||
|
bank[account] -= amount
|
|||
|
return
|
|||
|
----
|
|||
|
|
|||
|
The executed code looks like the following:
|
|||
|
|
|||
|
----
|
|||
|
def subtract_funds(account: str, amount: int):
|
|||
|
''' Subtract funds from bank account then <RLI>''' ;return
|
|||
|
bank[account] -= amount
|
|||
|
return
|
|||
|
----
|
|||
|
|
|||
|
== Compliant Solution
|
|||
|
|
|||
|
No hidden BIDI characters are present:
|
|||
|
|
|||
|
----
|
|||
|
def subtract_funds(account: str, amount: int):
|
|||
|
''' Subtract funds from bank account then return; '''
|
|||
|
bank[account] -= amount
|
|||
|
return
|
|||
|
----
|
|||
|
|
|||
|
include::../see.adoc[]
|
|||
|
|
|||
|
ifdef::env-github,rspecator-view[]
|
|||
|
|
|||
|
'''
|
|||
|
== Implementation Specification
|
|||
|
(visible only on this page)
|
|||
|
|
|||
|
include::../message.adoc[]
|
|||
|
|
|||
|
include::../highlighting.adoc[]
|
|||
|
|
|||
|
'''
|
|||
|
|
|||
|
endif::env-github,rspecator-view[]
|