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

adodb_strip_order_by() throws deprecated warnings on PHP 8.1 #869

Closed
dregad opened this issue Sep 8, 2022 · 0 comments · Fixed by #871
Closed

adodb_strip_order_by() throws deprecated warnings on PHP 8.1 #869

dregad opened this issue Sep 8, 2022 · 0 comments · Fixed by #871
Assignees
Labels
bug core ADOdb core (library and base classes) PHP8.1 PHP8.1 Compatibility Issues
Milestone

Comments

@dregad
Copy link
Member

dregad commented Sep 8, 2022

Deprecated:  strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in ./adodb/adodb-lib.inc.php on line 39
Deprecated:  str_replace(): Passing null to parameter #1 ($search) of type array|string is deprecated in ./adodb/adodb-lib.inc.php on line 55

To reproduce, call pageExecute with a SELECT statement without an ORDER BY clause:

$db->pageExecute('SELECT * FROM table');
@dregad dregad added bug core ADOdb core (library and base classes) PHP8.1 PHP8.1 Compatibility Issues labels Sep 8, 2022
@dregad dregad added this to the v5.22.4 milestone Sep 8, 2022
@dregad dregad self-assigned this Sep 8, 2022
dregad added a commit to dregad/ADOdb that referenced this issue Sep 8, 2022
The replacement of preg_match() by preg_match_all() in commit
8eaf842 basically made most of the
code in the function useless (the block parsing the SQL statement for
paretheses was never called).

Also, the logic to retrieve the last ORDER BY clause was a bit
contrived.

Fixes ADOdb#869
@dregad dregad closed this as completed in 85c27f0 Sep 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug core ADOdb core (library and base classes) PHP8.1 PHP8.1 Compatibility Issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant