Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/getgrav/grav into 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
mahagr committed Oct 12, 2017
2 parents 4e6738c + 974fc55 commit c7be8eb
Show file tree
Hide file tree
Showing 10 changed files with 1,348 additions and 636 deletions.
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,18 @@
* Make it possible to include debug bar also into non-HTML responses

# v1.3.5
## xx/xx/2017
## 10/11/2017

1. [](#improved)
* Refactored `URI` class with numerous bug fixes, and optimizations
* Override `system.media.upload_limit` with PHP's `post_max_size` or `upload_max_filesize`
* Updated `bin/grav clean` command to remove unnecessary vendor files (save some bytes)
* Added a `http_status_code` Twig function to allow setting HTTP status codes from Twig directly.
* Deter XSS attacks via URI path/uri methods (credit:newbthenewbd)
* Added support for `$uri->toArray()` and `(string)$uri`
* Added support for `type` on `Asstes::addInlineJs()` [#1683](https://github.com/getgrav/grav/pull/1683)
1. [](#bugfix)
* Fixed method signature error with `GPM\InstallCommand::processPackage()` [#1682](https://github.com/getgrav/grav/pull/1682)

# v1.3.4
## 09/29/2017
Expand Down
9 changes: 0 additions & 9 deletions system/blueprints/config/system.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -934,15 +934,6 @@ form:
validate:
type: bool

media.upload_limit:
type: text
append: bytes
label: PLUGIN_ADMIN.UPLOAD_LIMIT
help: PLUGIN_ADMIN.UPLOAD_LIMIT_HELP
classes: small
validate:
type: number

media.enable_media_timestamp:
type: toggle
label: PLUGIN_ADMIN.ENABLE_MEDIA_TIMESTAMP
Expand Down
1 change: 0 additions & 1 deletion system/config/system.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ images:

media:
enable_media_timestamp: false # Enable media timestamps
upload_limit: 0 # Set maximum upload size in bytes (0 is unlimited)
unsupported_inline_types: [] # Array of supported media types to try to display inline
allowed_fallback_types: [] # Array of allowed media types of files found if accessed via Page route
auto_metadata_exif: false # Automatically create metadata files from Exif data where possible
Expand Down
2 changes: 1 addition & 1 deletion system/defines.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

// Some standard defines
define('GRAV', true);
define('GRAV_VERSION', '1.3.4');
define('GRAV_VERSION', '1.3.5');
//define('GRAV_TESTING', true);
define('DS', '/');

Expand Down
13 changes: 8 additions & 5 deletions system/src/Grav/Common/Assets.php
Original file line number Diff line number Diff line change
Expand Up @@ -465,12 +465,13 @@ public function addInlineCss($asset, $priority = null, $group = null)
* For adding chunks of string-based inline JS
*
* @param mixed $asset
* @param int $priority the priority, bigger comes first
* @param string $group name of the group
* @param int $priority the priority, bigger comes first
* @param string $group name of the group
* @param null $attributes
*
* @return $this
*/
public function addInlineJs($asset, $priority = null, $group = null)
public function addInlineJs($asset, $priority = null, $group = null, $attributes = null)
{
$asset = trim($asset);

Expand All @@ -485,7 +486,8 @@ public function addInlineJs($asset, $priority = null, $group = null)
'asset' => $asset,
'priority' => intval($priority ?: 10),
'order' => count($this->js),
'group' => $group ?: 'head'
'group' => $group ?: 'head',
'type' => $attributes ?: '',
];

// check for dynamic array and merge with defaults
Expand Down Expand Up @@ -667,7 +669,8 @@ public function js($group = 'head', $attributes = [])
}

if ($inline_js) {
$output .= "\n<script>\n" . $inline_js . "\n</script>\n";
$attribute_string = isset($inline) && $inline['type'] ? " type=\"" . $inline['type'] . "\"" : '';
$output .= "\n<script" . $attribute_string . ">\n" . $inline_js . "\n</script>\n";
}

return $output;
Expand Down
5 changes: 5 additions & 0 deletions system/src/Grav/Common/Config/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
use Grav\Common\Grav;
use Grav\Common\Data\Data;
use Grav\Common\Service\ConfigServiceProvider;
use Grav\Common\Utils;

class Config extends Data
{
Expand Down Expand Up @@ -95,6 +96,10 @@ public function init()
$this->joinDefaults($key, $value);
}
}

// Override the media.upload_limit based on PHP values
$upload_limit = Utils::getUploadLimit();
$this->items['system']['media']['upload_limit'] = $upload_limit > 0 ? $upload_limit : 1024*1024*1024;
}

/**
Expand Down
Loading

0 comments on commit c7be8eb

Please sign in to comment.