Skip to content

Commit

Permalink
Merge pull request #32373 from defrance/patch-987740
Browse files Browse the repository at this point in the history
fix login error on update with captcha
  • Loading branch information
eldy authored Dec 17, 2024
2 parents be5f58f + 7b10052 commit adb5248
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions htdocs/core/tpl/login.tpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* Copyright (C) 2011-2022 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 Charlene Benke <charlene@patas-monkey.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -317,7 +318,7 @@
}

// List of directories where we can find captcha handlers
$dirModCaptcha = array_merge(array('main' => '/core/modules/security/captcha/'), is_array($conf->modules_parts['captcha']) ? $conf->modules_parts['captcha'] : array());
$dirModCaptcha = array_merge(array('main' => '/core/modules/security/captcha/'), (isset($conf->modules_parts['captcha']) && is_array($conf->modules_parts['captcha'])) ? $conf->modules_parts['captcha'] : array());
$fullpathclassfile = '';
foreach ($dirModCaptcha as $dir) {
$fullpathclassfile = dol_buildpath($dir."modCaptcha".ucfirst($captcha).'.class.php', 0, 2);
Expand All @@ -334,7 +335,7 @@
$classname = "modCaptcha".ucfirst($captcha);
if (class_exists($classname)) {
/** @var ModeleCaptcha $captchaobj */
$captchaobj = new $classname($db, $conf, $langs, $user);
$captchaobj = new $classname($db, $conf, $langs, null);
'@phan-var-force ModeleCaptcha $captchaobj';

if (is_object($captchaobj) && method_exists($captchaobj, 'getCaptchaCodeForForm')) {
Expand Down

0 comments on commit adb5248

Please sign in to comment.