diff --git a/CHANGELOG.md b/CHANGELOG.md index d6b56ffe5..d9711490d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,13 @@ +# v1.4.8 +## 07/31/2018 + +1. [](#improved) + * Add Grav version to debug bar messages tab [#2106](https://github.com/getgrav/grav/pull/2106) + * Add Nginx config for ddev project to `webserver-configs` [#2117](https://github.com/getgrav/grav/pull/2117) + * Vendor library updates +1. [](#bugfix) + * Don't allow `null` to be set as Page content + # v1.4.7 ## 07/13/2018 @@ -6,7 +16,7 @@ 1. [](#bugfix) * Fix for modular page preview [#2066](https://github.com/getgrav/grav/issues/2066) * `Page::routeCanonical()` should be string not array [#2069](https://github.com/getgrav/grav/issues/2069) - + # v1.4.6 ## 06/20/2018 diff --git a/composer.lock b/composer.lock index ce312c9fd..3542085dc 100644 --- a/composer.lock +++ b/composer.lock @@ -244,16 +244,16 @@ }, { "name": "donatj/phpuseragentparser", - "version": "v0.9.0", + "version": "v0.10.0", "source": { "type": "git", "url": "https://github.com/donatj/PhpUserAgent.git", - "reference": "ea79de6a18e52285e62cd75cf1cebe276ecaf503" + "reference": "9de58cc2a3e986bfee7f4cea3365c830b765cf65" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/donatj/PhpUserAgent/zipball/ea79de6a18e52285e62cd75cf1cebe276ecaf503", - "reference": "ea79de6a18e52285e62cd75cf1cebe276ecaf503", + "url": "https://api.github.com/repos/donatj/PhpUserAgent/zipball/9de58cc2a3e986bfee7f4cea3365c830b765cf65", + "reference": "9de58cc2a3e986bfee7f4cea3365c830b765cf65", "shasum": "" }, "require": { @@ -291,7 +291,7 @@ "user agent", "useragent" ], - "time": "2017-10-23T16:52:52+00:00" + "time": "2018-06-21T15:54:46+00:00" }, { "name": "erusev/parsedown", @@ -1299,16 +1299,16 @@ }, { "name": "symfony/console", - "version": "v2.8.41", + "version": "v2.8.43", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "e8e59b74ad1274714dad2748349b55e3e6e630c7" + "reference": "42a0adc7dd656ca2e360285eb6d822df9ce0b160" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/e8e59b74ad1274714dad2748349b55e3e6e630c7", - "reference": "e8e59b74ad1274714dad2748349b55e3e6e630c7", + "url": "https://api.github.com/repos/symfony/console/zipball/42a0adc7dd656ca2e360285eb6d822df9ce0b160", + "reference": "42a0adc7dd656ca2e360285eb6d822df9ce0b160", "shasum": "" }, "require": { @@ -1356,7 +1356,7 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2018-05-15T21:17:45+00:00" + "time": "2018-07-09T12:58:09+00:00" }, { "name": "symfony/debug", @@ -1417,7 +1417,7 @@ }, { "name": "symfony/event-dispatcher", - "version": "v2.8.41", + "version": "v2.8.43", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", @@ -1650,16 +1650,16 @@ }, { "name": "symfony/var-dumper", - "version": "v2.8.41", + "version": "v2.8.43", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "c3d7a096ccaba86e2fadeb444ca32fcbc5a31ebd" + "reference": "b77b888c33407f9d4f6e7c6ab4fe7fb5336d41d7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/c3d7a096ccaba86e2fadeb444ca32fcbc5a31ebd", - "reference": "c3d7a096ccaba86e2fadeb444ca32fcbc5a31ebd", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/b77b888c33407f9d4f6e7c6ab4fe7fb5336d41d7", + "reference": "b77b888c33407f9d4f6e7c6ab4fe7fb5336d41d7", "shasum": "" }, "require": { @@ -1714,11 +1714,11 @@ "debug", "dump" ], - "time": "2018-04-25T14:40:02+00:00" + "time": "2018-07-04T15:34:47+00:00" }, { "name": "symfony/yaml", - "version": "v2.8.41", + "version": "v2.8.43", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", @@ -1768,20 +1768,21 @@ }, { "name": "twig/twig", - "version": "v1.35.3", + "version": "v1.35.4", "source": { "type": "git", "url": "https://github.com/twigphp/Twig.git", - "reference": "b48680b6eb7d16b5025b9bfc4108d86f6b8af86f" + "reference": "7e081e98378a1e78c29cc9eba4aefa5d78a05d2a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig/zipball/b48680b6eb7d16b5025b9bfc4108d86f6b8af86f", - "reference": "b48680b6eb7d16b5025b9bfc4108d86f6b8af86f", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/7e081e98378a1e78c29cc9eba4aefa5d78a05d2a", + "reference": "7e081e98378a1e78c29cc9eba4aefa5d78a05d2a", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=5.3.3", + "symfony/polyfill-ctype": "^1.8" }, "require-dev": { "psr/container": "^1.0", @@ -1820,16 +1821,16 @@ }, { "name": "Twig Team", - "homepage": "http://twig.sensiolabs.org/contributors", + "homepage": "https://twig.symfony.com/contributors", "role": "Contributors" } ], "description": "Twig, the flexible, fast, and secure template language for PHP", - "homepage": "http://twig.sensiolabs.org", + "homepage": "https://twig.symfony.com", "keywords": [ "templating" ], - "time": "2018-03-20T04:25:58+00:00" + "time": "2018-07-13T07:12:17+00:00" } ], "packages-dev": [ @@ -1985,16 +1986,16 @@ }, { "name": "codeception/phpunit-wrapper", - "version": "6.0.9", + "version": "6.0.10", "source": { "type": "git", "url": "https://github.com/Codeception/phpunit-wrapper.git", - "reference": "450f1cfc5f49539c421061e64338f5edb8baad6a" + "reference": "7057e599d97b02b4efb009681a43b327dbce138a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Codeception/phpunit-wrapper/zipball/450f1cfc5f49539c421061e64338f5edb8baad6a", - "reference": "450f1cfc5f49539c421061e64338f5edb8baad6a", + "url": "https://api.github.com/repos/Codeception/phpunit-wrapper/zipball/7057e599d97b02b4efb009681a43b327dbce138a", + "reference": "7057e599d97b02b4efb009681a43b327dbce138a", "shasum": "" }, "require": { @@ -2027,7 +2028,7 @@ } ], "description": "PHPUnit classes used by Codeception", - "time": "2018-03-31T18:50:01+00:00" + "time": "2018-06-20T20:08:14+00:00" }, { "name": "codeception/stub", @@ -2170,16 +2171,16 @@ }, { "name": "fzaninotto/faker", - "version": "v1.7.1", + "version": "v1.8.0", "source": { "type": "git", "url": "https://github.com/fzaninotto/Faker.git", - "reference": "d3ed4cc37051c1ca52d22d76b437d14809fc7e0d" + "reference": "f72816b43e74063c8b10357394b6bba8cb1c10de" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/fzaninotto/Faker/zipball/d3ed4cc37051c1ca52d22d76b437d14809fc7e0d", - "reference": "d3ed4cc37051c1ca52d22d76b437d14809fc7e0d", + "url": "https://api.github.com/repos/fzaninotto/Faker/zipball/f72816b43e74063c8b10357394b6bba8cb1c10de", + "reference": "f72816b43e74063c8b10357394b6bba8cb1c10de", "shasum": "" }, "require": { @@ -2187,7 +2188,7 @@ }, "require-dev": { "ext-intl": "*", - "phpunit/phpunit": "^4.0 || ^5.0", + "phpunit/phpunit": "^4.8.35 || ^5.7", "squizlabs/php_codesniffer": "^1.5" }, "type": "library", @@ -2216,7 +2217,7 @@ "faker", "fixtures" ], - "time": "2017-08-15T16:48:10+00:00" + "time": "2018-07-12T10:23:15+00:00" }, { "name": "guzzlehttp/guzzle", @@ -3293,7 +3294,7 @@ }, { "name": "symfony/browser-kit", - "version": "v3.4.11", + "version": "v3.4.13", "source": { "type": "git", "url": "https://github.com/symfony/browser-kit.git", @@ -3350,7 +3351,7 @@ }, { "name": "symfony/css-selector", - "version": "v3.4.11", + "version": "v3.4.13", "source": { "type": "git", "url": "https://github.com/symfony/css-selector.git", @@ -3403,16 +3404,16 @@ }, { "name": "symfony/dom-crawler", - "version": "v3.4.11", + "version": "v3.4.13", "source": { "type": "git", "url": "https://github.com/symfony/dom-crawler.git", - "reference": "201b210fafcdd193c1e45b2994bf7133fb6263e8" + "reference": "54c9e817b74c7be1840344bf4feaa7a7d02abfb8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/201b210fafcdd193c1e45b2994bf7133fb6263e8", - "reference": "201b210fafcdd193c1e45b2994bf7133fb6263e8", + "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/54c9e817b74c7be1840344bf4feaa7a7d02abfb8", + "reference": "54c9e817b74c7be1840344bf4feaa7a7d02abfb8", "shasum": "" }, "require": { @@ -3456,20 +3457,20 @@ ], "description": "Symfony DomCrawler Component", "homepage": "https://symfony.com", - "time": "2018-05-01T22:53:27+00:00" + "time": "2018-07-05T11:53:23+00:00" }, { "name": "symfony/finder", - "version": "v3.4.11", + "version": "v3.4.13", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "472a92f3df8b247b49ae364275fb32943b9656c6" + "reference": "3a8c3de91d2b2c68cd2d665cf9d00f7ef9eaa394" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/472a92f3df8b247b49ae364275fb32943b9656c6", - "reference": "472a92f3df8b247b49ae364275fb32943b9656c6", + "url": "https://api.github.com/repos/symfony/finder/zipball/3a8c3de91d2b2c68cd2d665cf9d00f7ef9eaa394", + "reference": "3a8c3de91d2b2c68cd2d665cf9d00f7ef9eaa394", "shasum": "" }, "require": { @@ -3505,20 +3506,20 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", - "time": "2018-05-16T08:49:21+00:00" + "time": "2018-06-19T20:52:10+00:00" }, { "name": "symfony/process", - "version": "v3.4.11", + "version": "v3.4.13", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "4cbf2db9abcb01486a21b7a059e03a62fae63187" + "reference": "f741672edfcfe3a2ea77569d419006f23281d909" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/4cbf2db9abcb01486a21b7a059e03a62fae63187", - "reference": "4cbf2db9abcb01486a21b7a059e03a62fae63187", + "url": "https://api.github.com/repos/symfony/process/zipball/f741672edfcfe3a2ea77569d419006f23281d909", + "reference": "f741672edfcfe3a2ea77569d419006f23281d909", "shasum": "" }, "require": { @@ -3554,7 +3555,7 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2018-05-16T08:49:21+00:00" + "time": "2018-07-09T09:01:07+00:00" }, { "name": "victorjonsson/markdowndocs", diff --git a/system/defines.php b/system/defines.php index 5e737f590..bc4e90cfa 100644 --- a/system/defines.php +++ b/system/defines.php @@ -8,7 +8,7 @@ // Some standard defines define('GRAV', true); -define('GRAV_VERSION', '1.4.7'); +define('GRAV_VERSION', '1.4.8'); define('GRAV_TESTING', false); define('DS', '/'); diff --git a/system/src/Grav/Common/Debugger.php b/system/src/Grav/Common/Debugger.php index 4687325e1..f89b19ca0 100644 --- a/system/src/Grav/Common/Debugger.php +++ b/system/src/Grav/Common/Debugger.php @@ -60,6 +60,7 @@ class Debugger if ($this->enabled()) { $this->debugbar->addCollector(new ConfigCollector((array)$this->config->get('system'), 'Config')); $this->debugbar->addCollector(new ConfigCollector((array)$this->config->get('plugins'), 'Plugins')); + $this->addMessage('Grav v' . GRAV_VERSION); } return $this; diff --git a/system/src/Grav/Common/Page/Page.php b/system/src/Grav/Common/Page/Page.php index 3954efe26..c4db2037c 100644 --- a/system/src/Grav/Common/Page/Page.php +++ b/system/src/Grav/Common/Page/Page.php @@ -813,6 +813,8 @@ class Page */ public function setRawContent($content) { + $content = $content === null ? '': $content; + $this->content = $content; } diff --git a/webserver-configs/nginx-ddev-site.conf b/webserver-configs/nginx-ddev-site.conf new file mode 100644 index 000000000..e75cf2ff1 --- /dev/null +++ b/webserver-configs/nginx-ddev-site.conf @@ -0,0 +1,118 @@ +# ddev GravCMS config + +# You can override ddev's configuration by placing an edited copy +# of this config (or one of the other ones) in .ddev/nginx-site.conf +# See https://ddev.readthedocs.io/en/latest/users/extend/customization-extendibility/#providing-custom-nginx-configuration + +# Set https to 'on' if x-forwarded-proto is https +map $http_x_forwarded_proto $fcgi_https { + default off; + https on; +} + +server { + listen 80; ## listen for ipv4; this line is default and implied + listen [::]:80 default ipv6only=on; ## listen for ipv6 + # The NGINX_DOCROOT variable is substituted with + # its value when the container is started. + root $NGINX_DOCROOT; + index index.php index.htm index.html; + + # Make site accessible from http://localhost/ + server_name _; + + # Disable sendfile as per https://docs.vagrantup.com/v2/synced-folders/virtualbox.html + sendfile off; + error_log /var/log/nginx/error.log info; + access_log /var/log/nginx/access.log; + + location / { + absolute_redirect off; + try_files $uri $uri/ /index.php?$query_string; + } + + # pass the PHP scripts to FastCGI server listening on socket + location ~ \.php$ { + try_files $uri =404; + fastcgi_split_path_info ^(.+\.php)(/.+)$; + fastcgi_pass unix:/run/php-fpm.sock; + fastcgi_buffers 16 16k; + fastcgi_buffer_size 32k; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + fastcgi_param SCRIPT_NAME $fastcgi_script_name; + fastcgi_index index.php; + include fastcgi_params; + fastcgi_intercept_errors on; + # fastcgi_read_timeout should match max_execution_time in php.ini + fastcgi_read_timeout 10m; + fastcgi_param SERVER_NAME $host; + fastcgi_param HTTPS $fcgi_https; + } + + # Expire rules for static content + # Feed + location ~* \.(?:rss|atom|cache)$ { + expires 1h; + } + + # Media: images, icons, video, audio, HTC + location ~* \.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|svgz|mp4|ogg|ogv|webm|htc)$ { + expires 1M; + access_log off; + add_header Cache-Control "public"; + } + + # Prevent clients from accessing hidden files (starting with a dot) + # This is particularly important if you store .htpasswd files in the site hierarchy + # Access to `/.well-known/` is allowed. + # https://www.mnot.net/blog/2010/04/07/well-known + # https://tools.ietf.org/html/rfc5785 + location ~* /\.(?!well-known\/) { + deny all; + } + + # Prevent clients from accessing to backup/config/source files + location ~* (?:\.(?:bak|conf|dist|fla|in[ci]|log|psd|sh|sql|sw[op])|~)$ { + deny all; + } + + ## Begin - Security + # deny all direct access for these folders + location ~* /(\.git|cache|bin|logs|backup|tests)/.*$ { return 403; } + # deny running scripts inside core system folders + location ~* /(system|vendor)/.*\.(txt|xml|md|html|yaml|yml|php|pl|py|cgi|twig|sh|bat)$ { return 403; } + # deny running scripts inside user folder + location ~* /user/.*\.(txt|md|yaml|yml|php|pl|py|cgi|twig|sh|bat)$ { return 403; } + # deny access to specific files in the root folder + location ~ /(LICENSE\.txt|composer\.lock|composer\.json|nginx\.conf|web\.config|htaccess\.txt|\.htaccess) { return 403; } + ## End - Security + + + ## provide a health check endpoint + location /healthcheck { + access_log off; + stub_status on; + keepalive_timeout 0; # Disable HTTP keepalive + return 200; + } + + error_page 400 401 /40x.html; + location = /40x.html { + root /usr/share/nginx/html; + } + + location ~ ^/(fpmstatus|ping)$ { + access_log off; + stub_status on; + keepalive_timeout 0; # Disable HTTP keepalive + allow 127.0.0.1; + allow all; + fastcgi_index index.php; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + include fastcgi_params; + fastcgi_pass unix:/run/php-fpm.sock; + } + + +} +