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

USU is not with PHP 8 #67

Open
Aurelienazerty opened this issue Apr 24, 2023 · 4 comments
Open

USU is not with PHP 8 #67

Aurelienazerty opened this issue Apr 24, 2023 · 4 comments
Labels

Comments

@Aurelienazerty
Copy link

USU seems not compatible with PHP 8

In index I've got lot of :

[phpBB Debug] PHP Warning: in file [ROOT]/ext/phpbbseo/usu/core/traits/url.php on line 324: Undefined array key 1
[phpBB Debug] PHP Warning: in file [ROOT]/ext/phpbbseo/usu/core/traits/rewriter.php on line 161: Undefined array key "author"
[phpBB Debug] PHP Warning: in file [ROOT]/ext/phpbbseo/usu/core/traits/rewriter.php on line 330: Undefined array key "start"
[phpBB Debug] PHP Warning: in file [ROOT]/ext/phpbbseo/usu/core/traits/rewriter.php on line 241: Undefined array key "sr"

And going to topic make error :

General Error
INSECURE_REDIRECT

BACKTRACE

FILE: (not given by php)
LINE: (not given by php)
CALL: msg_handler()

FILE: [ROOT]/ext/phpbbseo/usu/core/traits/seo.php
LINE: 127
CALL: trigger_error()

FILE: [ROOT]/ext/phpbbseo/usu/core/core.php
LINE: 730
CALL: phpbbseo\usu\core\core->seo_redirect()

FILE: [ROOT]/ext/phpbbseo/usu/event/listener.php
LINE: 354
CALL: phpbbseo\usu\core\core->zero_dupe()

FILE: [ROOT]/vendor/symfony/event-dispatcher/EventDispatcher.php
LINE: 214
CALL: phpbbseo\usu\event\listener->core_user_setup()

FILE: [ROOT]/vendor/symfony/event-dispatcher/EventDispatcher.php
LINE: 44
CALL: Symfony\Component\EventDispatcher\EventDispatcher->doDispatch()

FILE: [ROOT]/phpbb/event/dispatcher.php
LINE: 62
CALL: Symfony\Component\EventDispatcher\EventDispatcher->dispatch()

FILE: [ROOT]/phpbb/event/dispatcher.php
LINE: 46
CALL: phpbb\event\dispatcher->dispatch()

FILE: [ROOT]/phpbb/user.php
LINE: 222
CALL: phpbb\event\dispatcher->trigger_event()

FILE: [ROOT]/viewtopic.php
LINE: 356
CALL: phpbb\user->setup()
@meis2m
Copy link
Member

meis2m commented May 2, 2023

@Dark1z

@zetrader
Copy link

I don't have this with phpbb 3.3.10 and php 8.2.9, what do i have to do to see those errors?

@Aurelienazerty
Copy link
Author

It's when you put "Activate the Zero duplicate" to yes.

@Aurelienazerty
Copy link
Author

I put a var_dump to see what's appened on line 122 in seo.php

var_dump($url, $url_parts, $url_parts === false, empty($url_parts['scheme']), !in_array($url_parts['scheme'], $allowed_protocols));

It print :

string(47) "./../../forum/viewtopic.php?f=15&t=3196&start=0" array(2) { ["path"]=> string(27) "./../../forum/viewtopic.php" ["query"]=> string(19) "f=15&t=3196&start=0" } bool(false) bool(true) bool(true)

As you can see, the $url is relative, so there is no scheme, we go in the if :

if ($url_parts === false || empty($url_parts['scheme']) || !in_array($url_parts['scheme'], $allowed_protocols))
{
	send_status_line(400, 'Bad Request');

	trigger_error('INSECURE_REDIRECT', E_USER_ERROR);
}

I don't know why it came with php 8.x I didn't have this problem with php 7.4 and I didn't made any code change.

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

No branches or pull requests

3 participants