reference/intl/spoofchecker/areconfusable.xml
1976eae0d815797af97a1e16c5cd90ffc2868395
...
...
@@ -1,52 +1,49 @@
1
1
<?xml version="1.0" encoding="utf-8"?>
2
2
<!-- $Revision$ -->
3
-

4
3
<refentry xml:id="spoofchecker.areconfusable" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
5
4
<refnamediv>
6
5
<refname>Spoofchecker::areConfusable</refname>
7
-
<refpurpose>Checks if a given text contains any confusable characters</refpurpose>
6
+
<refpurpose>Checks if given strings can be confused</refpurpose>
8
7
</refnamediv>
9
8

10
9
<refsect1 role="description">
11
10
&reftitle.description;
12
-
<methodsynopsis>
11
+
<methodsynopsis role="Spoofchecker">
13
12
<modifier>public</modifier> <type>bool</type><methodname>Spoofchecker::areConfusable</methodname>
14
-
<methodparam><type>string</type><parameter>s1</parameter></methodparam>
15
-
<methodparam><type>string</type><parameter>s2</parameter></methodparam>
16
-
<methodparam choice="opt"><type>string</type><parameter role="reference">error</parameter></methodparam>
13
+
<methodparam><type>string</type><parameter>string1</parameter></methodparam>
14
+
<methodparam><type>string</type><parameter>string2</parameter></methodparam>
15
+
<methodparam choice="opt"><type>int</type><parameter role="reference">errorCode</parameter><initializer>&null;</initializer></methodparam>
17
16
</methodsynopsis>
18
17
<para>
19
-

18
+
Checks whether two given strings can easily be mistaken.
20
19
</para>
21
-

22
-
&warn.undocumented.func;
23
-

24
20
</refsect1>
25
21

26
22
<refsect1 role="parameters">
27
23
&reftitle.parameters;
28
24
<variablelist>
29
25
<varlistentry>
30
-
<term><parameter>s1</parameter></term>
26
+
<term><parameter>string1</parameter></term>
31
27
<listitem>
32
28
<para>
33
-
29
+
First string to check.
34
30
</para>
35
31
</listitem>
36
32
</varlistentry>
37
33
<varlistentry>
38
-
<term><parameter>s2</parameter></term>
34
+
<term><parameter>string2</parameter></term>
39
35
<listitem>
40
36
<para>
41
-
37
+
Second string to check.
42
38
</para>
43
39
</listitem>
44
40
</varlistentry>
45
41
<varlistentry>
46
-
<term><parameter>error</parameter></term>
42
+
<term><parameter>errorCode</parameter></term>
47
43
<listitem>
48
44
<para>
49
-
45
+
This variable is set by-reference to &integer; containing an error, if there
46
+
was any.
50
47
</para>
51
48
</listitem>
52
49
</varlistentry>
...
...
@@ -56,13 +53,31 @@
56
53
<refsect1 role="returnvalues">
57
54
&reftitle.returnvalues;
58
55
<para>
59
-

56
+
Returns &true; if two given strings can be confused, &false; otherwise.
60
57
</para>
61
58
</refsect1>
62
59

60
+
<refsect1 role="examples">
61
+
&reftitle.examples;
62
+
<para>
63
+
<example>
64
+
<title><function>Spoofchecker::areConfusable</function> example</title>
65
+
<programlisting role="php">
66
+
<![CDATA[
67
+
<?php
68
+
$checker = new Spoofchecker();
63
69

64
-
</refentry>
70
+
$checker->areConfusable('google.com', 'goog1e.com'); // true
71
+
// Lower l can be confused with digit one
65
72

73
+
$checker->areConfusable('google.com', 'g00g1e.com'); // false
74
+
// Zero (0) cannot be easily confused with "o" letter
75
+
]]>
76
+
</programlisting>
77
+
</example>
78
+
</para>
79
+
</refsect1>
80
+
</refentry>
66
81
<!-- Keep this comment at the end of the file
67
82
Local variables:
68
83
mode: sgml
69
84