mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
Fix line widthds and add uncommitted file.
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@341115 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
a7e1318ee8
commit
7e597caa52
3 changed files with 21 additions and 10 deletions
|
@ -12,8 +12,16 @@
|
|||
<section xml:id="spoofchecker.intro">
|
||||
&reftitle.intro;
|
||||
<para>
|
||||
|
||||
This class is provided because Unicode contains large number of characters
|
||||
and incorporates the varied writing systems of the world and their incorrect
|
||||
usage can expose programs or systems to possible security attacks using
|
||||
characters similarity.
|
||||
</para>
|
||||
<param>
|
||||
Provided methods alllow to check whether an individual string is likely an attempt
|
||||
at confusing the reader (<literal>spoof detection</literal>), such as "pаypаl"
|
||||
spelled with Cyrillic 'а' characters.
|
||||
</param>
|
||||
</section>
|
||||
<!-- }}} -->
|
||||
|
||||
|
|
|
@ -11,8 +11,8 @@
|
|||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<modifier>public</modifier> <type>bool</type><methodname>Spoofchecker::areConfusable</methodname>
|
||||
<methodparam><type>string</type><parameter>string1</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>string2</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>str1</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>str2</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>string</type><parameter role="reference">error</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
|
@ -24,7 +24,7 @@
|
|||
&reftitle.parameters;
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><parameter>string1</parameter></term>
|
||||
<term><parameter>str1</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
First string to check.
|
||||
|
@ -32,7 +32,7 @@
|
|||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>string2</parameter></term>
|
||||
<term><parameter>str2</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Second string to check.
|
||||
|
@ -68,9 +68,11 @@
|
|||
<?php
|
||||
$checker = new Spoofchecker();
|
||||
|
||||
$checker->areConfusable('google.com', 'goog1e.com'); // true: lower l can be confused with digit one
|
||||
$checker->areConfusable('google.com', 'g00g1e.com'); // false: zero digit cannot be confused with "o" letter
|
||||
?>
|
||||
$checker->areConfusable('google.com', 'goog1e.com'); // true
|
||||
// Lower l can be confused with digit one
|
||||
|
||||
$checker->areConfusable('google.com', 'g00g1e.com'); // false
|
||||
// Zero (0) cannot be easily confused with "o" letter
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
|
|
|
@ -61,8 +61,9 @@
|
|||
$checker = new Spoofchecker();
|
||||
|
||||
$checker->isSuspicious('google.com'); // true: only ASCII characters
|
||||
$checker->isSuspicious('Рaypal.com'); // false: the first letter is from Cyrylic, not a regular latin "P"
|
||||
?>
|
||||
|
||||
$checker->isSuspicious('Рaypal.com'); // false
|
||||
// The first letter is from Cyrylic, not a regular latin "P"
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
|
|
Loading…
Reference in a new issue