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

fix "strpos empty needle" warning #2

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

nicoder
Copy link

@nicoder nicoder commented Jul 8, 2020

fixes issue greenlion#320

a warning was issued in PositionCalculator#findPositionWithinString
when calling strpos on an empty value:

Warning: strpos(): Empty needle in
src/PHPSQLParser/positions/PositionCalculator.php on line 138

=> return false earlier in that case, to then throw an exception

nicoder added 2 commits June 17, 2020 16:36
fixes issue greenlion#320

a warning was issued in `PositionCalculator#findPositionWithinString`
when calling `strpos` on an empty value:

```
Warning: strpos(): Empty needle in
src/PHPSQLParser/positions/PositionCalculator.php on line 138
```

=> return `false` earlier in that case, to then throw an exception
PHP Parse error:  syntax error, unexpected 'class' (T_CLASS), expecting
identifier (T_STRING) or variable (T_VARIABLE) or '{' or '$' in
/home/travis/build/greenlion/PHP-SQL-Parser/tests/cases/parser/issue320Test.php
on line 55
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

Successfully merging this pull request may close these issues.

1 participant