Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get_magic_quotes_gpc error on api authentication #77

Open
marloesim opened this issue Oct 26, 2021 · 5 comments
Open

get_magic_quotes_gpc error on api authentication #77

marloesim opened this issue Oct 26, 2021 · 5 comments

Comments

@marloesim
Copy link

Hi,

I am trying to use the API to fetch bookings. The authentication request returns an error.

Code: 8192
Message: Function get_magic_quotes_gpc() is deprecated

Trace
#0 https://mylocalpath.nl/lib/external/Slim/Http/Util.php(59): Slim\Slim::handleErrors(8192, 'Function get_ma...', 'https://mylocalpath.nl....', 59, Array)
#1 https://mylocalpath.nl/lib/external/Slim/Http/Request.php(242): Slim\Http\Util::stripSlashesIfMagicQuotes(Array)
#2 https://mylocalpath.nl/lib/external/Slim/Middleware/MethodOverride.php(88): Slim\Http\Request->post('_METHOD')
#3 https://mylocalpath.nl/lib/external/Slim/Middleware/PrettyExceptions.php(67): Slim\Middleware\MethodOverride->call()
#4 https://mylocalpath.nl/lib/external/Slim/Slim.php(1167): Slim\Middleware\PrettyExceptions->call()
#5 https://mylocalpath.nl/Web/Services/index.php(67): Slim\Slim->run()
#6 {main}

Since get_magic_quotes_gpc is deprecated I would think this function should not be called?
How do I get the authentication with the API working?

@effgarces
Copy link
Collaborator

Despite being deprecated it should still work, provided that you are using a php 7, that function was removed in php 8.

@marloesim
Copy link
Author

Well that's odd because it does not work.

In the response it says:
Slim Application Error
The application could not run because of the following error:
(error as entered before)

When I remove the get_magic_quotes_gpc function call from util.php (which of course is not what I want to do...) The authorisation works...

@effgarces
Copy link
Collaborator

That function is only run if magicquotes is enabled, which in this day and age should already be disabled for quite sometime, so you can simply replace it with:
public static function stripSlashesIfMagicQuotes($rawData, $overrideStripSlashes = null) { return $rawData; }
and it should work fine, but bear in mind that I didn't test it

@effgarces
Copy link
Collaborator

Just adding some extra info, that code is part of the slim framework, booked uses it (i believe) for the api and it really needs to be upgraded soon.

@qlux
Copy link
Contributor

qlux commented Nov 2, 2021

In the meantime you can ignore the deprecated warnings by replacing the first line of the config.php:

error_reporting(E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED);

That's what the Slim community recommends

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants