Throw RuntimeException on invalid content dirs
This commit is contained in:
parent
3e4bcd4289
commit
d252df4b98
@ -11,6 +11,7 @@ Released: -
|
|||||||
want to parse the contents of a page, use the `content` filter instead
|
want to parse the contents of a page, use the `content` filter instead
|
||||||
* [Changed] Improve documentation
|
* [Changed] Improve documentation
|
||||||
* [Changed] Improve table styling in default theme
|
* [Changed] Improve table styling in default theme
|
||||||
|
* [Changed] Throw a RuntimeException when the `content` dir isn't accessible
|
||||||
* [Changed] Reuse `ParsedownExtra` object; new `onParsedownRegistration` event
|
* [Changed] Reuse `ParsedownExtra` object; new `onParsedownRegistration` event
|
||||||
* [Fixed] `PicoDeprecated`: Sanitize `content_dir` and `base_url` options when
|
* [Fixed] `PicoDeprecated`: Sanitize `content_dir` and `base_url` options when
|
||||||
reading `config.php` in Picos root dir
|
reading `config.php` in Picos root dir
|
||||||
|
@ -266,7 +266,8 @@ class Pico
|
|||||||
* meta headers, processes Markdown, does Twig processing and returns
|
* meta headers, processes Markdown, does Twig processing and returns
|
||||||
* the rendered contents.
|
* the rendered contents.
|
||||||
*
|
*
|
||||||
* @return string rendered Pico contents
|
* @return string rendered Pico contents
|
||||||
|
* @throws RuntimeException thrown when a not recoverable error occurs
|
||||||
*/
|
*/
|
||||||
public function run()
|
public function run()
|
||||||
{
|
{
|
||||||
@ -281,6 +282,11 @@ class Pico
|
|||||||
$this->loadConfig();
|
$this->loadConfig();
|
||||||
$this->triggerEvent('onConfigLoaded', array(&$this->config));
|
$this->triggerEvent('onConfigLoaded', array(&$this->config));
|
||||||
|
|
||||||
|
// check content dir
|
||||||
|
if (!is_dir($this->getConfig('content_dir'))) {
|
||||||
|
throw new RuntimeException('Invalid content directory "' . $this->getConfig('content_dir') . '"');
|
||||||
|
}
|
||||||
|
|
||||||
// evaluate request url
|
// evaluate request url
|
||||||
$this->evaluateRequestUrl();
|
$this->evaluateRequestUrl();
|
||||||
$this->triggerEvent('onRequestUrl', array(&$this->requestUrl));
|
$this->triggerEvent('onRequestUrl', array(&$this->requestUrl));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user