Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.10.15

Bug #20086 Wrong RegExp in go-pear.phar
Submitted: 2013-10-06 00:02 UTC
From: jcdr Assigned: avb
Status: Closed Package: PEAR (version 1.9.4)
PHP Version: 5.5.3 OS: All
Roadmaps: 1.9.5    
Subscription  


 [2013-10-06 00:02 UTC] jcdr (Jean De Ryck)
Description: ------------ RegExp in line 5471 of go-pear.phar should be changed from: if (preg_match('/(\\/|\\\\|^)([^\\/\\\\]+)?php(.+)?$/', to: if (preg_match('/(\\/|\\\\|^)([^\\/\\\\]+)?php([^\\/\\\\]+)?$/', Test script: --------------- In builder.php: function build($descfile, $callback = null) { if (preg_match('/(\\/|\\\\|^)([^\\/\\\\]+)?php([^\\/\\\\]+)$/', $this->config->get('php_bin'), $matches)) { if (isset($matches[2]) && strlen($matches[2]) && trim($matches[2]) != trim($this->config->get('php_prefix'))) { $this->log(0, 'WARNING: php_bin ' . $this->config->get('php_bin') . ' appears to have a prefix ' . $matches[2] . ', but' . ' config variable php_prefix does not match'); } if (isset($matches[3]) && strlen($matches[3]) && trim($matches[3]) != trim($this->config->get('php_suffix'))) { $this->log(0, 'WARNING: php_bin ' . $this->config->get('php_bin') . ' appears to have a suffix ' . $matches[3] . ', but' . ' config variable php_suffix does not match'); } } Expected result: ---------------- php_bin = "C:\Program Files\EasyPHP-DevServer-13.1VC11\binaries\php\php_runningversion\php.exe" $matches = array (size=4) 0 => string '\php.exe' (length=8) 1 => string '\' (length=1) 2 => string '' (length=0) 3 => string '.exe' (length=4) Actual result: -------------- php_bin = "C:\Program Files\EasyPHP-DevServer-13.1VC11\binaries\php\php_runningversion\php.exe" $matches = array (size=4) 0 => string '\php\php_runningversion\php.exe' (length=31) 1 => string '\' (length=1) 2 => string '' (length=0) 3 => string '\php_runningversion\php.exe' (length=27)

Comments

 [2014-02-05 08:15 UTC] doconnor (Daniel O'Connor)
Can you open a pull request please
 [2014-03-02 23:35 UTC] avb (Alexey Borzov)
-Assigned To: +Assigned To: avb
Pull request added: https://github.com/pear/pear-core/pull/29
 [2014-03-04 20:01 UTC] doconnor (Daniel O'Connor)
-Status: Assigned +Status: Closed
This bug has been fixed in SVN. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better.
 [2014-05-30 00:31 UTC] cweiske (Christian Weiske)
-Roadmap Versions: +Roadmap Versions: 1.9.5
 [2014-06-03 03:32 UTC] cweiske (Christian Weiske)
Cherry-picked into stable branch for version 1.9.5.