diff -Nru php7.0-7.0.4/debian/changelog php7.0-7.0.4/debian/changelog --- php7.0-7.0.4/debian/changelog 2016-04-14 00:01:18.000000000 -0700 +++ php7.0-7.0.4/debian/changelog 2016-04-20 19:05:53.000000000 -0700 @@ -1,3 +1,11 @@ +php7.0 (7.0.4-7ubuntu3) xenial; urgency=medium + + * debian/patches/0053-backport-68ebfc87.patch: Fix bug #71624, + PHP_MODE_PROCESS_STDIN (CLI SAPI called with '-R') did not properly + set $argi and $argn. Closes LP: #1572465. + + -- Nishanth Aravamudan Wed, 20 Apr 2016 19:05:43 -0700 + php7.0 (7.0.4-7ubuntu2) xenial; urgency=medium * debian/patches/0052-backport-186844be.patch: Fix bug #71695: Global diff -Nru php7.0-7.0.4/debian/patches/0053-backport-68ebfc87.patch php7.0-7.0.4/debian/patches/0053-backport-68ebfc87.patch --- php7.0-7.0.4/debian/patches/0053-backport-68ebfc87.patch 1969-12-31 16:00:00.000000000 -0800 +++ php7.0-7.0.4/debian/patches/0053-backport-68ebfc87.patch 2016-04-20 19:05:38.000000000 -0700 @@ -0,0 +1,74 @@ +Description: Fix bug #71624, PHP_MODE_PROCESS_STDIN (CLI SAPI called with '-R') did not properly set $argi and $argn +Author: Nishanth Aravamudan +Origin: upstream, https://github.com/php/php-src/commit/68ebfc87ad4f3842cd680c32ab307344c8659ce3 +Bug: https://bugs.php.net/bug.php?id=71624 +Bug-Ubuntu: https://bugs.launchpad.net/bugs/1572465 + +--- php7.0-7.0.4.orig/sapi/cli/php_cli.c ++++ php7.0-7.0.4/sapi/cli/php_cli.c +@@ -1018,16 +1018,15 @@ static int do_cli(int argc, char **argv) + if (exec_begin && zend_eval_string_ex(exec_begin, NULL, "Command line begin code", 1) == FAILURE) { + exit_status=254; + } +- ZVAL_LONG(&argi, index); +- zend_hash_str_update(&EG(symbol_table), "argi", sizeof("argi")-1, &argi); + while (exit_status == SUCCESS && (input=php_stream_gets(s_in_process, NULL, 0)) != NULL) { + len = strlen(input); + while (len > 0 && len-- && (input[len]=='\n' || input[len]=='\r')) { + input[len] = '\0'; + } +- ZVAL_STRINGL(&argn, input, len); ++ ZVAL_STRINGL(&argn, input, len + 1); + zend_hash_str_update(&EG(symbol_table), "argn", sizeof("argn")-1, &argn); +- Z_LVAL(argi) = ++index; ++ ZVAL_LONG(&argi, ++index); ++ zend_hash_str_update(&EG(symbol_table), "argi", sizeof("argi")-1, &argi); + if (exec_run) { + if (zend_eval_string_ex(exec_run, NULL, "Command line run code", 1) == FAILURE) { + exit_status=254; +--- /dev/null ++++ php7.0-7.0.4/sapi/cli/tests/bug71624.phpt +@@ -0,0 +1,43 @@ ++--TEST-- ++Bug #61977 Test that -R properly sets argi and argn ++--SKIPIF-- ++ ++--FILE-- ++ ++--EXPECT-- ++string(6) "1 ++2 ++3 ++" ++string(15) "foo ++test ++hello ++" ++Done diff -Nru php7.0-7.0.4/debian/patches/series php7.0-7.0.4/debian/patches/series --- php7.0-7.0.4/debian/patches/series 2016-04-14 00:01:18.000000000 -0700 +++ php7.0-7.0.4/debian/patches/series 2016-04-20 19:04:14.000000000 -0700 @@ -50,3 +50,4 @@ 0050-Fix-use-of-UNDEF-instead-of-NULL-in-read_dimension.patch 0051-backport-89a43425.patch 0052-backport-186844be.patch +0053-backport-68ebfc87.patch