cvs: php-src /pear/PEAR Installer.php
| From: | Greg Beaver | Date: | Tue, 16 Sep 2003 03:17:08 +0000 |
| Subject: | cvs: php-src /pear/PEAR Installer.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-12768@lists.php.net to get a copy of this message | ||
cellog Mon Sep 15 23:17:08 2003 EDT
Modified files:
/php-src/pear/PEAR Installer.php
Log:
fix invalid replacements - add tests for bad pear-config/package-info replacements
Index: php-src/pear/PEAR/Installer.php
diff -u php-src/pear/PEAR/Installer.php:1.119 php-src/pear/PEAR/Installer.php:1.120
--- php-src/pear/PEAR/Installer.php:1.119 Mon Sep 15 22:42:44 2003
+++ php-src/pear/PEAR/Installer.php Mon Sep 15 23:17:08 2003
@@ -18,7 +18,7 @@
// | Martin Jansen <mj@php.net> |
// +----------------------------------------------------------------------+
//
-// $Id: Installer.php,v 1.119 2003/09/16 02:42:44 cellog Exp $
+// $Id: Installer.php,v 1.120 2003/09/16 03:17:08 cellog Exp $
require_once 'PEAR/Common.php';
require_once 'PEAR/Registry.php';
@@ -265,10 +265,19 @@
}
} elseif ($a['type'] == 'pear-config') {
$to = $this->config->get($a['to']);
+ if (is_null($to)) {
+ $this->log(0, "invalid pear-config replacement: $a[to]");
+ continue;
+ }
} elseif ($a['type'] == 'package-info') {
- $to = $this->pkginfo[$a['to']];
+ if (isset($this->pkginfo[$a['to']]) &&
is_string($this->pkginfo[$a['to']])) {
+ $to = $this->pkginfo[$a['to']];
+ } else {
+ $this->log(0, "invalid package-info replacement: $a[to]");
+ continue;
+ }
}
- if ($to) {
+ if (!is_null($to)) {
$subst_from[] = $a['from'];
$subst_to[] = $to;
}