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 @@ -31,6 +31,10 @@ PHP NEWS
31
31
. Fixed bug GH-10315 (FPM unknown child alert not valid). (Jakub Zelenka)
32
32
. Fixed bug GH-10385 (FPM successful config test early exit). (nielsdos)
33
33
34
+ - Intl:
35
+ . Fixed bug GH-10647 (Spoolchecker isSuspicious/areConfusable methods
36
+ error code's argument always returning NULL0. (Nathan Freeman)
37
+
34
38
- JSON:
35
39
. Fixed JSON scanner and parser generation build.
36
40
(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