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

Warning - ucwords() expects exactly 1 parameter, 2 given #14694

Closed
Findus23 opened this issue Jul 24, 2019 · 8 comments · Fixed by #14734 or #15650
Closed

Warning - ucwords() expects exactly 1 parameter, 2 given #14694

Findus23 opened this issue Jul 24, 2019 · 8 comments · Fixed by #14734 or #15650
Assignees
Labels
Regression Indicates a feature used to work in a certain way but it no longer does even though it should.
Milestone

Comments

@Findus23
Copy link
Member

reported in https://forum.matomo.org/t/warning-messages-ucwords-expects-exactly-1-parameter-after-update-to-3-11-0/33611
introduced in #14449

$camelName = ucwords($name, '-');

It seems like the second parameter has only been introduced in PHP 5.5.16, but Matomo supports (I think 5.5.9+)
https://3v4l.org/Uf3Ya
https://stackoverflow.com/questions/42575390/is-ucwords-delimiter-parameter-supported-in-php-5-6

@Findus23 Findus23 added the Regression Indicates a feature used to work in a certain way but it no longer does even though it should. label Jul 24, 2019
@tsteur tsteur added this to the 3.12.0 milestone Jul 24, 2019
@tsteur
Copy link
Member

tsteur commented Jul 24, 2019

We will need to detect the PHP version and change logic based on this. I would say in PHP.5.5.9-PHP 5.5.15 we can simply not include the ucwords and assume user is not using curl2? Could also just explode instead and run strtoupper and all elements and then implode again...

@Findus23
Copy link
Member Author

Disabling the fix in #14449 for the affected PHP versions sounds fine to me. No one apart from me even reported the original issue and as you say an ancient PHP version in combination with a really new curl version would be odd.

@sommer-gei
Copy link

sommer-gei commented Feb 26, 2020

Well done, but I wonder why this patch is not in the current 3.13.3 release?

@sgiehl
Copy link
Member

sgiehl commented Feb 26, 2020

actually it should be included. But @sommer-gei which php version are you using and which error do you still get? 🤔

@sommer-gei
Copy link

@sgiehl: Same error as in the issue title "Warning - ucwords() expects exactly 1 parameter, 2 given" with PHP 5.5.9 (yes I know it’s old).
I can’t see the fix in https://github.com/matomo-org/matomo/blob/3.13.3/core/Http.php#L937

Thanks for your Feedback!

@sgiehl
Copy link
Member

sgiehl commented Feb 27, 2020

Yeah you're right. That has been remove again in #14877
Can't say why 🤷‍♂

@sgiehl sgiehl reopened this Feb 27, 2020
@sgiehl sgiehl modified the milestones: 3.12.0, 3.13.4 Feb 27, 2020
@diosmosis
Copy link
Member

cc @tsteur not sure if this was due to a code merge issue or if there was a reason to remove it?

@tsteur
Copy link
Member

tsteur commented Feb 27, 2020

Probably some github merge issue. We've had it a few times that suddenly some commit magically disappeared. Be good to add it again

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Regression Indicates a feature used to work in a certain way but it no longer does even though it should.
Projects
None yet
6 participants