File tree 3 files changed +32
-2
lines changed 3 files changed +32
-2
lines changed Original file line number Diff line number Diff line change @@ -37,6 +37,10 @@ PHP NEWS
37
37
- GMP:
38
38
. Properly implement GMP::__construct(). (nielsdos)
39
39
40
+ - Intl:
41
+ . Fixed bug GH-10647 (Spoolchecker isSuspicious/areConfusable methods
42
+ error code's argument always returning NULL0. (Nathan Freeman)
43
+
40
44
- JSON:
41
45
. Fixed JSON scanner and parser generation build.
42
46
(Daniel Black, Jakub Zelenka)
Original file line number Diff line number Diff line change @@ -43,7 +43,8 @@ PHP_METHOD(Spoofchecker, isSuspicious)
43
43
44
44
if (error_code ) {
45
45
zval_ptr_dtor (error_code );
46
- ZVAL_LONG (error_code , ret );
46
+ ZVAL_LONG (Z_REFVAL_P (error_code ), ret );
47
+ Z_TRY_ADDREF_P (error_code );
47
48
}
48
49
RETVAL_BOOL (ret != 0 );
49
50
}
@@ -76,7 +77,8 @@ PHP_METHOD(Spoofchecker, areConfusable)
76
77
77
78
if (error_code ) {
78
79
zval_ptr_dtor (error_code );
79
- ZVAL_LONG (error_code , ret );
80
+ ZVAL_LONG (Z_REFVAL_P (error_code ), ret );
81
+ Z_TRY_ADDREF_P (error_code );
80
82
}
81
83
RETVAL_BOOL (ret != 0 );
82
84
}
Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ Bug GH-10647 (Spoofchecker::isSuspicious $errorCode always null)
3
+ --SKIPIF--
4
+ <?php
5
+ if (!extension_loaded ("intl " )) die ("skip intl extension not available " );
6
+ ?>
7
+ --FILE--
8
+ <?php
9
+ $ error = 123 ;
10
+ var_dump ($ error );
11
+
12
+ $ x = new Spoofchecker ();
13
+ var_dump ($ x ->isSuspicious ("\u{041F}aypal.com " , $ error ));
14
+ var_dump ($ error );
15
+
16
+ var_dump ($ x ->areConfusable ('google.com ' , 'goog1e.com ' , $ error ));
17
+ var_dump ($ error );
18
+ ?>
19
+ --EXPECTF--
20
+ int(123)
21
+ bool(true)
22
+ int(%d)
23
+ bool(true)
24
+ int(%d)
You can’t perform that action at this time.
0 commit comments