php error on clean install ver. 3.11

Please report bugs here!

Moderator: Thorsten

Post Reply
treichelt
Posts: 26
Joined: Fri May 20, 2016 12:14 am

php error on clean install ver. 3.11

Post by treichelt »

i get this with debug enabled on a clean install when trying to access the login page Latest version 3.11

phpMyFAQ Fatal error
Uncaught exception: 'ErrorException'
Message: 'filter_var(): Passing null to parameter #3 ($options) of type array|int is deprecated'
Stack trace:
#0 [internal function]: phpMyFAQ\Core\Error::errorHandler(8192, 'filter_var(): P...', 'D:\\phpmyfaq\\src...', 68)
#1 D:\phpmyfaq\src\phpMyFAQ\Filter.php(68): filter_var('/index.php', 518, NULL)
#2 D:\phpmyfaq\src\phpMyFAQ\Link.php(798): phpMyFAQ\Filter::filterVar('/index.php', 518)
#3 D:\phpmyfaq\index.php(319): phpMyFAQ\Link->getCurrentUrl()
#4 {main}
Thrown in 'D:\phpmyfaq\src\phpMyFAQ\Filter.php' on line 68

Danke Thorsten
Thorsten
Posts: 15560
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: php error on clean install ver. 3.11

Post by Thorsten »

Hi,

which PHP version do you use? It's "just" a deprecation error.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
treichelt
Posts: 26
Joined: Fri May 20, 2016 12:14 am

Re: php error on clean install ver. 3.11

Post by treichelt »

i am using 3.1.1 I must have had something else going on. it is working now, able to login.
when it wasn't working i turned on debug and received that message.
we still cannot use ldap with this new version. using php 8 and same ldap configuration as before on the previous version.
we login using domain\username .

Danke
Thorsten
Posts: 15560
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: php error on clean install ver. 3.11

Post by Thorsten »

HI,

this is the fix for your issue mentioned in the first post: https://github.com/thorsten/phpMyFAQ/co ... 8ab803212b

Did the LDAP access worked for you in 3.0?

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
treichelt
Posts: 26
Joined: Fri May 20, 2016 12:14 am

Re: php error on clean install ver. 3.11

Post by treichelt »

yes, ldap worked on 3.0

I'll apply this fix and will report back

Danke schoen

Thorsten
treichelt
Posts: 26
Joined: Fri May 20, 2016 12:14 am

Re: php error on clean install ver. 3.11

Post by treichelt »

i applied the fix and when logging in now i don't get an error about the wrong login but just a white page
if i login with the build in account i get to the regular main page
with debug enabled it just shows one error line 720 for a depricated function nothing else

Danke

Thorsten
Thorsten
Posts: 15560
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: php error on clean install ver. 3.11

Post by Thorsten »

Hi,

line 720 in which file?

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
treichelt
Posts: 26
Joined: Fri May 20, 2016 12:14 am

Re: php error on clean install ver. 3.11

Post by treichelt »

Debug enabled getting below
I can actually leave ldap enabled with the same ldap configuration that worked on the previous version but get an error 500, see pic at bottom

phpMyFAQ Fatal error


Uncaught exception: 'ErrorException'
Message: 'strtoupper(): Passing null to parameter #1 ($string) of type string is deprecated'
Stack trace:
#0 [internal function]: phpMyFAQ\Core\Error::errorHandler(8192, 'strtoupper(): P...', 'D:\\phpmyfaq\\src...', 270)
#1 D:\phpmyfaq\src\phpMyFAQ\Language.php(270): strtoupper(NULL)
#2 D:\phpmyfaq\index.php(276): phpMyFAQ\Language::isASupportedLanguage(NULL)
#3 {main}
Thrown in 'D:\phpmyfaq\src\phpMyFAQ\Language.php' on line 270



Line 270 in language.php

/**
* True if the language is supported by the current phpMyFAQ installation.
*
* @param string|null $langCode Language code
*
* @return bool
*/
public static function isASupportedLanguage(?string $langCode): bool
{
global $languageCodes;

return isset($languageCodes[strtoupper($langCode)]);
}

/**
Thorsten
Posts: 15560
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: php error on clean install ver. 3.11

Post by Thorsten »

Hi,

this is a known error, I fixed it for the upcoming 3.1.2 release: https://github.com/thorsten/phpMyFAQ/co ... 8a032f54e2

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
Post Reply