Permalink
Browse files

Fixed a PHP5.3 issue.

  • Loading branch information...
Cody Lundquist
Cody Lundquist committed Apr 13, 2013
1 parent fd16f78 commit 57a83f2b0ad6a22ac9c8884605d4b6e0e0770879
Showing with 5 additions and 4 deletions.
  1. +3 −2 src/Munee/Request.php
  2. +2 −2 tests/Munee/Cases/RequestTest.php
View
@@ -150,7 +150,8 @@ public function init()
$this->ext = pathinfo($this->rawFiles, PATHINFO_EXTENSION);
$supportedExtensions = Registry::getSupportedExtensions($this->ext);
// Suppressing errors because Exceptions thrown in the callback cause Warnings.
$this->files = @array_map(function($v) use ($supportedExtensions) {
$webroot = $this->webroot;
$this->files = @array_map(function($v) use ($supportedExtensions, $webroot) {
// Make sure all the file extensions are supported
if (! in_array(strtolower(pathinfo($v, PATHINFO_EXTENSION)), $supportedExtensions)) {
throw new ErrorException('All requested files need to be: ' . implode(', ', $supportedExtensions));
@@ -165,7 +166,7 @@ public function init()
}
}
return $this->webroot . $v;
return $webroot . $v;
}, explode(',', $this->rawFiles));
}
@@ -66,11 +66,11 @@ public function testConstructor()
* Make sure files are parsed properly and the extension is set
*/
public function testInit()
{
{
$_GET = array(
'files' => '/js/foo.js,/js/bar.js'
);
$Request = new Request();
$Request->init();

0 comments on commit 57a83f2

Please sign in to comment.