Skip to content

Commit d7e998f

Browse files
author
cpriest
committed
2 parents 42ac3f0 + 6e1b84a commit d7e998f

File tree

5 files changed

+68
-7
lines changed

5 files changed

+68
-7
lines changed

Zend/tests/generators/finally_ran_on_close.phpt

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,18 @@ finally is run even if a generator is closed mid-execution
55

66
function gen() {
77
try {
8-
echo "before yield\n";
9-
yield;
10-
echo "after yield\n";
8+
try {
9+
echo "before yield\n";
10+
yield;
11+
echo "after yield\n";
12+
} finally {
13+
echo "finally run\n";
14+
}
15+
echo "code after finally\n";
1116
} finally {
12-
echo "finally run\n";
17+
echo "second finally run\n";
1318
}
14-
15-
echo "code after finally\n";
19+
echo "code after second finally\n";
1620
}
1721

1822
$gen = gen();
@@ -23,3 +27,4 @@ unset($gen);
2327
--EXPECT--
2428
before yield
2529
finally run
30+
second finally run

Zend/zend_generators.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ void zend_generator_close(zend_generator *generator, zend_bool finished_executio
6060
* the resume. */
6161
if (finally_op_num) {
6262
execute_data->opline = &op_array->opcodes[finally_op_num];
63+
execute_data->fast_ret = NULL;
6364
generator->flags |= ZEND_GENERATOR_FORCED_CLOSE;
6465
zend_generator_resume(generator TSRMLS_CC);
6566
return;

ext/imap/php_imap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1191,7 +1191,7 @@ static void php_imap_do_open(INTERNAL_FUNCTION_PARAMETERS, int persistent)
11911191
if (zend_hash_index_find(Z_ARRVAL_PP(disabled_auth_method), i, (void **) &z_auth_method) == SUCCESS) {
11921192
if (Z_TYPE_PP(z_auth_method) == IS_STRING) {
11931193
if (Z_STRLEN_PP(z_auth_method) > 1) {
1194-
mail_parameters (NIL, DISABLE_AUTHENTICATOR, (void *)Z_STRVAL_PP(disabled_auth_method));
1194+
mail_parameters (NIL, DISABLE_AUTHENTICATOR, (void *)Z_STRVAL_PP(z_auth_method));
11951195
}
11961196
} else {
11971197
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid argument, expect string or array of strings");

ext/imap/tests/bug63126.phpt

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
--TEST--
2+
imap_open() DISABLE_AUTHENTICATOR ignores array param
3+
--SKIPIF--
4+
<?php
5+
extension_loaded('imap') or die('skip imap extension not available in this build');
6+
7+
require_once(dirname(__FILE__).'/imap_include.inc');
8+
9+
$in = imap_open($default_mailbox, $username, $password, OP_HALFOPEN, 1);
10+
if (!$in) {
11+
die("skip could not connect to mailbox $default_mailbox");
12+
}
13+
$kerberos = false;
14+
if (is_array($errors = imap_errors())) {
15+
foreach ($errors as $err) {
16+
if (strstr($err, 'GSSAPI') || strstr($err, 'Kerberos')) {
17+
$kerberos = true;
18+
}
19+
}
20+
}
21+
if (!$kerberos) {
22+
die("skip need a GSSAPI/Kerberos aware server");
23+
}
24+
?>
25+
--FILE--
26+
<?php
27+
$tests = array(
28+
'Array' => array('DISABLE_AUTHENTICATOR' => array('GSSAPI','NTLM')),
29+
'String' => array('DISABLE_AUTHENTICATOR' => 'GSSAPI'),
30+
);
31+
require_once(dirname(__FILE__).'/imap_include.inc');
32+
foreach ($tests as $name => $testparams) {
33+
echo "Test for $name\n";
34+
$in = imap_open($default_mailbox, $username, $password, OP_HALFOPEN, 1, $testparams);
35+
if ($in) {
36+
if (is_array($errors = imap_errors())) {
37+
foreach ($errors as $err) {
38+
if (strstr($err, 'GSSAPI') || strstr($err, 'Kerberos')) {
39+
echo "$err\n";
40+
}
41+
}
42+
}
43+
} else {
44+
echo "Can't connect\n";
45+
}
46+
}
47+
echo "Done\n";
48+
?>
49+
--EXPECTF--
50+
Test for Array
51+
Test for String
52+
Done

ext/sqlite3/config0.m4

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ if test $PHP_SQLITE3 != "no"; then
5050
PHP_CHECK_LIBRARY(sqlite3,sqlite3_key,[
5151
AC_DEFINE(HAVE_SQLITE3_KEY, 1, [have commercial sqlite3 with crypto support])
5252
])
53+
PHP_CHECK_LIBRARY(sqlite3,sqlite3_column_table_name,[
54+
AC_DEFINE(SQLITE_ENABLE_COLUMN_METADATA, 1, [have sqlite3 with column metadata enabled])
55+
])
5356

5457
PHP_CHECK_LIBRARY(sqlite3,sqlite3_load_extension,
5558
[],

0 commit comments

Comments
 (0)