diff --git a/CHANGELOG.md b/CHANGELOG.md index c59c71670..f421172cb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). +## [Unreleased] + +### Fixed + +- [645](https://github.com/owncloud/richdocuments/pull/645) - Give the remaining app config settings an empty-string default, so opening a document no longer logs a PHP deprecation on every open + ## [4.3.1] - 2026-09-22 ### Security @@ -209,7 +215,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). ## [2.4.0] - 2020-07-30 -[Unreleased]: https://github.com/owncloud/richdocuments/compare/v4.2.0...master +[Unreleased]: https://github.com/owncloud/richdocuments/compare/v4.3.1...master [4.2.0]: https://github.com/owncloud/richdocuments/compare/v4.1.0...v4.2.0 [4.1.0]: https://github.com/owncloud/richdocuments/compare/v4.0.0...v4.1.0 [4.0.0]: https://github.com/owncloud/richdocuments/compare/v3.0.1...v4.0.0 diff --git a/lib/AppConfig.php b/lib/AppConfig.php index 068ff2f8a..6e03a26f1 100644 --- a/lib/AppConfig.php +++ b/lib/AppConfig.php @@ -29,6 +29,11 @@ class AppConfig { 'zotero' => 'false', 'watermark_text' => '', 'test_server_groups' => '', + 'edit_groups' => '', + 'wopi_url' => '', + 'test_wopi_url' => '', + 'doc_format' => '', + 'menu_option' => '', 'canonical_webroot' => '', ]; diff --git a/tests/unit/AppConfigTest.php b/tests/unit/AppConfigTest.php index 81002841c..32e4d4a61 100644 --- a/tests/unit/AppConfigTest.php +++ b/tests/unit/AppConfigTest.php @@ -50,6 +50,32 @@ public function testOpenInNewtabDefault() { $this->assertEquals(true, $enterpriseEdition); } + public function stringSettingProvider() { + return [ + ['edit_groups'], + ['wopi_url'], + ['test_wopi_url'], + ['doc_format'], + ['menu_option'], + ]; + } + + /** + * Settings holding a string must default to an empty string, never to null, + * so that consumers passing them to string functions do not run into the + * PHP 8.1 deprecation of null arguments. + * + * @dataProvider stringSettingProvider + */ + public function testStringSettingDefaultsToEmptyString($key) { + $this->config->expects($this->once()) + ->method('getAppValue') + ->with('richdocuments', $key, $this->identicalTo('')) + ->willReturn(''); + + $this->assertSame('', $this->appConfig->getAppValue($key)); + } + public function enterpriseFeaturesEnabledProvider() { return [ [true, 'false', true],