Skip to content

Commit 44a35c9

Browse files
authored
Fix E_DEPRECATED in phar (#6824)
shell_exec() can return null both when an error occurs or the program produces no output, or return false when popen failed, and treating null/false as an empty string has no effect on the behavior of phar here.
1 parent b145256 commit 44a35c9

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

ext/phar/phar/pharcommand.inc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -223,13 +223,13 @@ class PharCommand extends CLICommand
223223
}
224224
}
225225
if ($pear) {
226-
$apiver = `pear -q info PHP_Archive 2>/dev/null|grep 'API Version'`;
226+
$apiver = (string) `pear -q info PHP_Archive 2>/dev/null|grep 'API Version'`;
227227
$apiver = trim(substr($apiver, strlen('API Version')));
228228
}
229229
if ($apiver) {
230230
self::notice("PEAR package PHP_Archive: API Version: $apiver.\n");
231-
$files = explode("\n", `pear list-files PHP_Archive`);
232-
$phpdir = `pear config-get php_dir 2>/dev/null`;
231+
$files = explode("\n", (string) `pear list-files PHP_Archive`);
232+
$phpdir = (string) `pear config-get php_dir 2>/dev/null`;
233233
$phpdir = trim($phpdir);
234234
self::notice("PEAR package PHP_Archive: $phpdir.\n");
235235
if (is_dir($phpdir)) {
@@ -246,7 +246,7 @@ class PharCommand extends CLICommand
246246
}
247247
}
248248
} else {
249-
self::notice("PEAR package PHP_Archive: corrupt or inaccessible base dir: $php_dir.\n");
249+
self::notice("PEAR package PHP_Archive: corrupt or inaccessible base dir: $phpdir.\n");
250250
}
251251
}
252252
if (isset($found)) {

0 commit comments

Comments
 (0)