Merge remote-tracking branch 'origin/feature/objects' into feature/objects

This commit is contained in:
Matias Griese
2017-03-17 11:18:58 +02:00
4 changed files with 16 additions and 3 deletions

View File

@@ -5,11 +5,14 @@
* Added default setting to only allow `direct-installs` from official GPM. Can be configured in `system.yaml`
* Added a new `Utils::isValidUrl()` method
* Added optional parameter to `|markdown(false)` filter to toggle block/line processing (default|true = `block`)
* Added new `Page::folderExists()` method
1. [](#improved)
* Genericized `direct-install` so it can be called via Admin plugin
1. [](#bugfix)
* Fixed a minor bug in Number validation [#1329](https://github.com/getgrav/grav/issues/1329)
* Fixed exception when trying to find user account and there is no `user://accounts` folder
* Fixed issue when setting `Page::expires(0)` [Admin #1009](https://github.com/getgrav/grav-plugin-admin/issues/1009)
* Removed ID from `nonce_field()` Twig function causing validation errors [Form #115](https://github.com/getgrav/grav-plugin-form/issues/115)
# v1.1.17
## 02/17/2017

View File

@@ -339,7 +339,7 @@ class Validation
protected static function filterNumber($value, array $params, array $field)
{
return self::validateFloat($value, $params) ? (float) $value : (int) $value;
return (string)(int)$value !== (string)(float)$value ? (float) $value : (int) $value;
}
protected static function filterDateTime($value, array $params, array $field)

View File

@@ -1208,7 +1208,7 @@ class Page
$this->expires = $var;
}
return empty($this->expires) ? Grav::instance()['config']->get('system.pages.expires') : $this->expires;
return !isset($this->expires) ? Grav::instance()['config']->get('system.pages.expires') : $this->expires;
}
/**
@@ -2560,6 +2560,16 @@ class Page
return $file && $file->exists();
}
/**
* Returns whether or not the current folder exists
*
* @return bool
*/
public function folderExists()
{
return file_exists($this->path());
}
/**
* Cleans the path.
*

View File

@@ -784,7 +784,7 @@ class TwigExtension extends \Twig_Extension
*/
public function nonceFieldFunc($action, $nonceParamName = 'nonce')
{
$string = '<input type="hidden" id="' . $nonceParamName . '" name="' . $nonceParamName . '" value="' . Utils::getNonce($action) . '" />';
$string = '<input type="hidden" name="' . $nonceParamName . '" value="' . Utils::getNonce($action) . '" />';
return $string;
}