diff options
author | nashe <thomas@chauchefoin.fr> | 2017-05-28 13:51:10 +0200 |
---|---|---|
committer | nashe <thomas@chauchefoin.fr> | 2017-05-28 13:51:10 +0200 |
commit | d2bb29ea95842059f9ae4dfe841d143ddf779258 (patch) | |
tree | 5fe34561c13d652b741c76af08b4de17a781d3b6 | |
parent | b3610f17ef53dd3b3455614263ffd809843b101c (diff) | |
download | planet-d2bb29ea95842059f9ae4dfe841d143ddf779258.tar planet-d2bb29ea95842059f9ae4dfe841d143ddf779258.tar.gz planet-d2bb29ea95842059f9ae4dfe841d143ddf779258.tar.bz2 planet-d2bb29ea95842059f9ae4dfe841d143ddf779258.tar.xz planet-d2bb29ea95842059f9ae4dfe841d143ddf779258.zip |
Do not process postload.php requests if app not installed
-rwxr-xr-x | app/app.php | 5 | ||||
-rw-r--r-- | postload.php | 4 |
2 files changed, 5 insertions, 4 deletions
diff --git a/app/app.php b/app/app.php index dca9bc4..5cda95c 100755 --- a/app/app.php +++ b/app/app.php @@ -7,8 +7,7 @@ require_once __DIR__.'/../vendor/autoload.php'; $savedConfig = __DIR__.'/../custom/config.yml'; $moon_version = file_get_contents(__DIR__.'/../VERSION'); -if (is_file($savedConfig)){ - +if (is_installed()) { $conf = Spyc::YAMLLoad($savedConfig); // this is a check to upgrade older config file without l10n @@ -39,7 +38,7 @@ function custom_path($file = '') return __DIR__.'/../custom' . (!empty($file) ? '/'.$file : ''); } -function ensure_installed() +function is_installed() { return file_exists(custom_path('config.yml')) && file_exists(custom_path('people.opml')); } diff --git a/postload.php b/postload.php index 389f1d8..943a84e 100644 --- a/postload.php +++ b/postload.php @@ -2,7 +2,9 @@ require_once __DIR__.'/app/app.php'; -ensure_installed(); +if (!is_installed()) { + die(); +} $xml = new SimpleXMLElement(file_get_contents(custom_path('people.opml'))); |