mirror of
https://github.com/humhub/humhub.git
synced 2025-01-16 21:58:17 +01:00
Trim Base URL on save (#6737)
* Trim Base URL on save * Use url and trim validators for general setting "Base URL" --------- Co-authored-by: Lucas Bartholemy <luke-@users.noreply.github.com>
This commit is contained in:
parent
9e2411392c
commit
c5a8d91918
@ -3,6 +3,7 @@ HumHub Changelog
|
||||
|
||||
1.15.2 (Unreleased)
|
||||
-------------------------
|
||||
- Enh #6734: Trim Base URL on save
|
||||
- Fix #6708: Fix displaying of alert when RichText is changed on refresh a page
|
||||
|
||||
1.15.1 (December 13, 2023)
|
||||
|
@ -57,11 +57,8 @@ class BasicSettingsForm extends \yii\base\Model
|
||||
['defaultLanguage', 'in', 'range' => array_keys(Yii::$app->i18n->getAllowedLanguages())],
|
||||
[['defaultTimeZone', 'timeZone'], 'in', 'range' => \DateTimeZone::listIdentifiers()],
|
||||
[['tour', 'dashboardShowProfilePostForm', 'enableFriendshipModule', 'maintenanceMode'], 'in', 'range' => [0, 1]],
|
||||
[['baseUrl'], function ($attribute, $params, $validator) {
|
||||
if (substr($this->$attribute, 0, 7) !== 'http://' && substr($this->$attribute, 0, 8) !== 'https://') {
|
||||
$this->addError($attribute, Yii::t('AdminModule.base', 'Base URL needs to begin with http:// or https://'));
|
||||
}
|
||||
}],
|
||||
[['baseUrl'], 'url', 'pattern' => '/^{schemes}:\/\/([A-Z0-9][A-Z0-9_\-\.]*)+(?::\d{1,5})?(?:$|[?\/#])/i'],
|
||||
[['baseUrl'], 'trim'],
|
||||
['maintenanceModeInfo', 'safe'],
|
||||
];
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user