summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/errorhandler.php9
-rw-r--r--include/functions.php4
-rwxr-xr-xinclude/login_form.php22
3 files changed, 28 insertions, 7 deletions
diff --git a/include/errorhandler.php b/include/errorhandler.php
index 30b6902b3..ea464f77a 100644
--- a/include/errorhandler.php
+++ b/include/errorhandler.php
@@ -43,14 +43,13 @@ function format_backtrace($trace): string {
}
function ttrss_error_handler(int $errno, string $errstr, string $file, int $line): bool {
- /*if (version_compare(PHP_VERSION, '8.0.0', '<')) {
- if (error_reporting() == 0 || !$errno) return false;
+ // return true in order to avoid default error handling by PHP
+ if (version_compare(PHP_VERSION, '8.0.0', '<')) {
+ if (error_reporting() == 0 || !$errno) return true;
} else {
- if (!(error_reporting() & $errno)) return false;
+ if (!(error_reporting() & $errno)) return true;
}
- if (error_reporting() == 0 || !$errno) return false;*/
-
$file = substr(str_replace(dirname(__DIR__), "", $file), 1);
$context = format_backtrace(debug_backtrace());
diff --git a/include/functions.php b/include/functions.php
index 82e08ddb3..66f529bf7 100644
--- a/include/functions.php
+++ b/include/functions.php
@@ -69,6 +69,7 @@
"de_DE" => "Deutsch",
"fa" => "Persian (Farsi)",
"fr_FR" => "Français",
+ "gl" => "Galego",
"hu_HU" => "Magyar (Hungarian)",
"it_IT" => "Italiano",
"ja_JP" => "日本語 (Japanese)",
@@ -108,8 +109,7 @@
$valid_langs[$lang] = $t;
$lang = substr($lang, 0, 2);
- if (!isset($valid_langs[$lang]))
- $valid_langs[$lang] = $t;
+ $valid_langs[$lang] ??= $t;
}
// break up string into pieces (languages and q factors)
diff --git a/include/login_form.php b/include/login_form.php
index 2e0eb077f..a26a58cc9 100755
--- a/include/login_form.php
+++ b/include/login_form.php
@@ -32,6 +32,27 @@
<script type="text/javascript">
require({cache:{}});
</script>
+
+ <script type="text/javascript">
+ /* exported Plugins */
+ const Plugins = {};
+
+ <?php
+ foreach (PluginHost::getInstance()->get_plugins() as $n => $p) {
+ if (method_exists($p, "get_login_js")) {
+ $script = $p->get_login_js();
+
+ if ($script) {
+ echo "try {
+ $script
+ } catch (e) {
+ console.warn('failed to initialize plugin JS: $n', e);
+ }";
+ }
+ }
+ }
+ ?>
+ </script>
</head>
<body class="flat ttrss_utility ttrss_login css_loading">
@@ -175,6 +196,7 @@
<fieldset class="align-right">
<label> </label>
<?= \Controls\submit_tag(__('Log in')) ?>
+ <?php PluginHost::getInstance()->run_hooks(PluginHost::HOOK_LOGINFORM_ADDITIONAL_BUTTONS) ?>
</fieldset>
</form>