Skip to content

Commit

Permalink
3.7.1-Release
Browse files Browse the repository at this point in the history
  • Loading branch information
ikkez committed Dec 30, 2019
1 parent 4b3b73f commit 495a97c
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 20 deletions.
6 changes: 6 additions & 0 deletions lib/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
CHANGELOG

3.7.1 (30. Dezember 2019)
* Base->build: Add support for brace-enclosed route tokens
* Base->reroute, fix duplicate fragment issue on non-alias routes
* DB\SQL\Mapper: fix empty check for pkey when reloading after insert
* Web->minify: fix minification with multiple files, [bcosca/fatfree#1152](https://github.com/bcosca/fatfree/issues/1152), [#bcosca/fatfree#1169](https://github.com/bcosca/fatfree/issues/1169)

3.7.0 (26. November 2019)
* NEW: Matrix, added select and walk methods for array processing and validation tools
* NEW: Added configurable file locking via LOCK var
Expand Down
33 changes: 16 additions & 17 deletions lib/base.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ final class Base extends Prefab implements ArrayAccess {
//@{ Framework details
const
PACKAGE='Fat-Free Framework',
VERSION='3.7.0-Release';
VERSION='3.7.1-Release';
//@}

//@{ HTTP status codes (RFC 2616)
Expand Down Expand Up @@ -177,17 +177,17 @@ function build($url,$args=[]) {
}
else {
$i=0;
$url=preg_replace_callback('/@(\w+)|(\*)/',
$url=preg_replace_callback('/(\{)?@(\w+)(?(1)\})|(\*)/',
function($match) use(&$i,$args) {
if (isset($match[1]) &&
array_key_exists($match[1],$args))
return $args[$match[1]];
if (isset($match[2]) &&
array_key_exists($match[2],$args)) {
if (!is_array($args[$match[2]]))
return $args[$match[2]];
array_key_exists($match[2],$args))
return $args[$match[2]];
if (isset($match[3]) &&
array_key_exists($match[3],$args)) {
if (!is_array($args[$match[3]]))
return $args[$match[3]];
$i++;
return $args[$match[2]][$i-1];
return $args[$match[3]][$i-1];
}
return $match[0];
},$url);
Expand Down Expand Up @@ -1486,12 +1486,11 @@ function reroute($url=NULL,$permanent=FALSE,$die=TRUE) {
$url=$this->hive['REALM'];
if (is_array($url))
$url=call_user_func_array([$this,'alias'],$url);
elseif (preg_match('/^(?:@?([^\/()?#]+)(?:\((.+?)\))*(\?[^#]+)*(#.+)*)/',
$url,$parts) &&
isset($this->hive['ALIASES'][$parts[1]]))
$url=$this->hive['ALIASES'][$parts[1]];
$url=$this->build($url,isset($parts[2])?$this->parse($parts[2]):[]).
(isset($parts[3])?$parts[3]:'').(isset($parts[4])?$parts[4]:'');
elseif (preg_match('/^(?:@([^\/()?#]+)(?:\((.+?)\))*(\?[^#]+)*(#.+)*)/',
$url,$parts) && isset($this->hive['ALIASES'][$parts[1]]))
$url=$this->build($this->hive['ALIASES'][$parts[1]],
isset($parts[2])?$this->parse($parts[2]):[]).
(isset($parts[3])?$parts[3]:'').(isset($parts[4])?$parts[4]:'');
if (($handler=$this->hive['ONREROUTE']) &&
$this->call($handler,[$url,$permanent,$die])!==FALSE)
return;
Expand Down Expand Up @@ -2888,7 +2887,7 @@ protected function sandbox(array $hive=NULL,$mime=NULL) {
function render($file,$mime='text/html',array $hive=NULL,$ttl=0) {
$fw=$this->fw;
$cache=Cache::instance();
foreach (array_unique($fw->split($fw->UI)) as $dir) {
foreach ($fw->split($fw->UI) as $dir) {
if ($cache->exists($hash=$fw->hash($dir.$file),$data))
return $data;
if (is_file($this->file=$fw->fixslashes($dir.$file))) {
Expand Down Expand Up @@ -3100,7 +3099,7 @@ function render($file,$mime='text/html',array $hive=NULL,$ttl=0) {
$cache=Cache::instance();
if (!is_dir($tmp=$fw->TEMP))
mkdir($tmp,Base::MODE,TRUE);
foreach (array_unique($fw->split($fw->UI)) as $dir) {
foreach ($fw->split($fw->UI) as $dir) {
if ($cache->exists($hash=$fw->hash($dir.$file),$data))
return $data;
if (is_file($view=$fw->fixslashes($dir.$file))) {
Expand Down
2 changes: 1 addition & 1 deletion lib/db/sql/mapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ function insert() {
if ($field['pkey']) {
$field['previous']=$field['value'];
if (!$inc && $field['pdo_type']==\PDO::PARAM_INT &&
empty($field['value']) && !$field['nullable'])
is_null($field['value']) && !$field['nullable'])
$inc=$key;
$filter.=($filter?' AND ':'').$this->db->quotekey($key).'=?';
$nkeys[$nctr+1]=[$field['value'],$field['pdo_type']];
Expand Down
4 changes: 2 additions & 2 deletions lib/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -694,10 +694,11 @@ function minify($files,$mime=NULL,$header=TRUE,$path=NULL) {
if (!isset($path))
$path=$fw->UI.';./';
foreach (array_unique($fw->split($path,FALSE)) as $dir)
foreach ($files as $file)
foreach ($files as $i=>$file)
if (is_file($save=$fw->fixslashes($dir.$file)) &&
is_bool(strpos($save,'../')) &&
preg_match('/\.(css|js)$/i',$file)) {
unset($files[$i]);
if ($fw->CACHE &&
($cached=$cache->exists(
$hash=$fw->hash($save).'.'.$ext[0],$data)) &&
Expand Down Expand Up @@ -815,7 +816,6 @@ function minify($files,$mime=NULL,$header=TRUE,$path=NULL) {
$cache->set($hash,$data);
$dst.=$data;
}
break;
}
if (PHP_SAPI!='cli' && $header)
header('Content-Type: '.$mime.'; charset='.$fw->ENCODING);
Expand Down

0 comments on commit 495a97c

Please sign in to comment.