Skip to content

Commit f075571

Browse files
committed
Merge branch '81135'
* 81135: Fix #81135 unknown help topic in phpdbg fails assertion
2 parents ce41e22 + 2c33578 commit f075571

File tree

4 files changed

+21
-1
lines changed

4 files changed

+21
-1
lines changed

NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ PHP NEWS
88
- PDO OCI:
99
. Fixed bug #77120 (Support 'success with info' at connection).
1010
(Sergei Morozov)
11+
12+
- phpdbg:
13+
. Fixed bug #81135 (unknown help topic causes assertion failure). (krakjoe)
1114

1215
10 Jun 2021, PHP 8.1.0alpha1
1316

sapi/phpdbg/phpdbg_help.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,8 @@ PHPDBG_COMMAND(help) /* {{{ */
263263
pretty_print(get_help(cmd->name));
264264
return SUCCESS;
265265
}
266+
} else {
267+
phpdbg_error("No help topic found for %s", param->str);
266268
}
267269
}
268270
}

sapi/phpdbg/phpdbg_prompt.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1558,7 +1558,9 @@ int phpdbg_interactive(bool allow_async_unsafe, char *input) /* {{{ */
15581558
case FAILURE:
15591559
if (!(PHPDBG_G(flags) & PHPDBG_IS_STOPPING)) {
15601560
if (!allow_async_unsafe || phpdbg_call_register(&stack) == FAILURE) {
1561-
phpdbg_output_err_buf("%b");
1561+
if (PHPDBG_G(err_buf).active) {
1562+
phpdbg_output_err_buf("%b");
1563+
}
15621564
}
15631565
}
15641566
break;

sapi/phpdbg/tests/bug81135.phpt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
--TEST--
2+
Bug #81135: unknown help topic fails assertion
3+
--PHPDBG--
4+
help unknown
5+
q
6+
--FILE--
7+
<?php
8+
9+
?>
10+
--EXPECTF--
11+
[Successful compilation of %sbug81135.php]
12+
prompt> [No help topic found for unknown]
13+
prompt>

0 commit comments

Comments
 (0)