diff options
| author | 2021-01-14 17:28:45 -0500 | |
|---|---|---|
| committer | 2021-01-14 23:28:45 +0100 | |
| commit | 29fe125b4a18f7107b50e54c69184c4f1777bbf6 (patch) | |
| tree | d76446252588f6db51b50a697ff7649894817aa2 /app | |
| parent | e3457f7d7b56509048e3c1f53f05f278656e976c (diff) | |
Add constant for PHP requirements (#3369)
* Add constant for PHP requirements
This new constant is used for PHP version check.
This way, we won't forget to modify some part of the code base.
* Remove PHP version checks
Some checks were obsolete because they were checking unsupported
PHP versions.
Diffstat (limited to 'app')
| -rwxr-xr-x | app/Controllers/configureController.php | 7 | ||||
| -rw-r--r-- | app/install.php | 2 | ||||
| -rw-r--r-- | app/views/configure/system.phtml | 30 | ||||
| -rw-r--r-- | app/views/update/checkInstall.phtml | 2 |
4 files changed, 17 insertions, 24 deletions
diff --git a/app/Controllers/configureController.php b/app/Controllers/configureController.php index 6358f48c2..917879810 100755 --- a/app/Controllers/configureController.php +++ b/app/Controllers/configureController.php @@ -358,9 +358,6 @@ class FreshRSS_configure_Controller extends Minz_ActionController { Minz_Error::error(403); } - $can_enable_email_validation = version_compare(PHP_VERSION, '5.5') >= 0; - $this->view->can_enable_email_validation = $can_enable_email_validation; - if (Minz_Request::isPost()) { $limits = FreshRSS_Context::$system_conf->limits; $limits['max_registrations'] = Minz_Request::param('max-registrations', 1); @@ -370,9 +367,7 @@ class FreshRSS_configure_Controller extends Minz_ActionController { FreshRSS_Context::$system_conf->limits = $limits; FreshRSS_Context::$system_conf->title = Minz_Request::param('instance-name', 'FreshRSS'); FreshRSS_Context::$system_conf->auto_update_url = Minz_Request::param('auto-update-url', false); - if ($can_enable_email_validation) { - FreshRSS_Context::$system_conf->force_email_validation = Minz_Request::param('force-email-validation', false); - } + FreshRSS_Context::$system_conf->force_email_validation = Minz_Request::param('force-email-validation', false); FreshRSS_Context::$system_conf->save(); invalidateHttpCache(); diff --git a/app/install.php b/app/install.php index bb7d9de9d..5e75fe42c 100644 --- a/app/install.php +++ b/app/install.php @@ -371,7 +371,7 @@ function printStep1() { <?php if ($res['php'] == 'ok') { ?> <p class="alert alert-success"><span class="alert-head"><?= _t('gen.short.ok') ?></span> <?= _t('install.check.php.ok', PHP_VERSION) ?></p> <?php } else { ?> - <p class="alert alert-error"><span class="alert-head"><?= _t('gen.short.damn') ?></span> <?= _t('install.check.php.nok', PHP_VERSION, '5.6.0') ?></p> + <p class="alert alert-error"><span class="alert-head"><?= _t('gen.short.damn') ?></span> <?= _t('install.check.php.nok', PHP_VERSION, FRESHRSS_MIN_PHP_VERSION) ?></p> <?php } ?> <?php if ($res['pdo'] == 'ok') { ?> diff --git a/app/views/configure/system.phtml b/app/views/configure/system.phtml index 75117ee1c..79376bc4e 100644 --- a/app/views/configure/system.phtml +++ b/app/views/configure/system.phtml @@ -38,23 +38,21 @@ </div> </div> - <?php if ($this->can_enable_email_validation) { ?> - <div class="form-group"> - <div class="group-controls"> - <label class="checkbox" for="force-email-validation"> - <input - type="checkbox" - name="force-email-validation" - id="force-email-validation" - value="1" - <?= FreshRSS_Context::$system_conf->force_email_validation ? 'checked="checked"' : '' ?> - data-leave-validation="<?= FreshRSS_Context::$system_conf->force_email_validation ?>" - /> - <?= _t('admin.system.force_email_validation') ?> - </label> - </div> + <div class="form-group"> + <div class="group-controls"> + <label class="checkbox" for="force-email-validation"> + <input + type="checkbox" + name="force-email-validation" + id="force-email-validation" + value="1" + <?= FreshRSS_Context::$system_conf->force_email_validation ? 'checked="checked"' : '' ?> + data-leave-validation="<?= FreshRSS_Context::$system_conf->force_email_validation ?>" + /> + <?= _t('admin.system.force_email_validation') ?> + </label> </div> - <?php } ?> + </div> <div class="form-group"> <label class="group-name" for="max-feeds"><?= _t('admin.system.max-feeds') ?></label> diff --git a/app/views/update/checkInstall.phtml b/app/views/update/checkInstall.phtml index 183f914c0..8a05fa301 100644 --- a/app/views/update/checkInstall.phtml +++ b/app/views/update/checkInstall.phtml @@ -9,7 +9,7 @@ <p class="alert <?= $status ? 'alert-success' : 'alert-error' ?>"> <?php if ($key === 'php') { - echo _t('admin.check_install.' . $key . '.' . ($status ? 'ok' : 'nok'), PHP_VERSION, '5.6.0'); + echo _t('admin.check_install.' . $key . '.' . ($status ? 'ok' : 'nok'), PHP_VERSION, FRESHRSS_MIN_PHP_VERSION); } else { echo _t('admin.check_install.' . $key . '.' . ($status ? 'ok' : 'nok')); } |
