From: Banana Date: Wed, 6 Jan 2021 15:08:14 +0000 (+0100) Subject: config merge into one file. missing changelog. start of develop branch X-Git-Tag: 1.1~38 X-Git-Url: http://91.132.146.200/gitweb/?a=commitdiff_plain;h=03bade9bc66610ad28026ef9376b8b4f01377026;p=bibliotheca-php.git config merge into one file. missing changelog. start of develop branch --- diff --git a/CHANGELOG b/CHANGELOG new file mode 100644 index 0000000..fb0425b --- /dev/null +++ b/CHANGELOG @@ -0,0 +1,12 @@ +1.1 - Vortex Rikers () + * Cleanup and merge to one config file. Read upgrade + * Missing changelog file + * api has its own log file now. + +1.0 - Castle - (20210106) + * First usable version + * Using as a collection management software will work + * Rights management needs tweeking, so use the admin account for a start + * Documentation covers the basics + * Use it and give feedback. + * Also, make backups. diff --git a/VERSION b/VERSION index 07e97bc..bcff852 100644 --- a/VERSION +++ b/VERSION @@ -1,7 +1 @@ -1.0 - Castle - (20210106) - * First usable version - * Using as a collection management software will work - * Rights management needs tweeking, so use the admin account for a start - * Documentation covers the basics - * Use it and give feedback. - * Also, make backups. +1.1 - Vortex Rikers () diff --git a/upgrade/from-version-1.0.txt b/upgrade/from-version-1.0.txt index e69de29..36e2785 100644 --- a/upgrade/from-version-1.0.txt +++ b/upgrade/from-version-1.0.txt @@ -0,0 +1,3 @@ +# Migration of the config files into one config file +Please copy the new config/config.php.default to config/config.php and adapt the settings which you +have on the old config files. After that you can delete config/database|path|system files. diff --git a/webclient/api.php b/webclient/api.php index 506369b..cce16fd 100644 --- a/webclient/api.php +++ b/webclient/api.php @@ -2,7 +2,7 @@ /** * Bibliotheca webclient * - * Copyright 2018-2020 Johannes Keßler + * Copyright 2018-2021 Johannes Keßler * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,14 +16,33 @@ * limitations under the License. */ -# set to true if you need debug messages in error log file -define('DEBUG',false); -# set to ture if you need query log messages in error log file. -define('QUERY_DEBUG',false); +require_once './config/config.php'; -require_once './config/path.php'; -require_once './config/system.php'; -require_once './config/database.php'; +mb_http_output('UTF-8'); +mb_internal_encoding('UTF-8'); +ini_set('error_reporting',-1); // E_ALL & E_STRICT + +# check request +$_urlToParse = filter_var($_SERVER['QUERY_STRING'],FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_LOW); +if(!empty($_urlToParse)) { + # see http://de2.php.net/manual/en/regexp.reference.unicode.php + if(preg_match('/[\p{C}\p{M}\p{Sc}\p{Sk}\p{So}\p{Zl}\p{Zp}]/u',$_urlToParse) === 1) { + die('Malformed request. Make sure you know what you are doing.'); + } +} + +# set the error reporting +ini_set('log_errors',true); +ini_set('error_log',PATH_SYSTEMOUT.'/api.log'); +if(DEBUG === true) { + ini_set('display_errors',true); +} +else { + ini_set('display_errors',false); +} + +# time settings +date_default_timezone_set(TIMEZONE); # static helper class require_once 'lib/summoner.class.php'; diff --git a/webclient/config/config.php.default b/webclient/config/config.php.default new file mode 100644 index 0000000..edea87b --- /dev/null +++ b/webclient/config/config.php.default @@ -0,0 +1,56 @@ +