Skip to content

Commit

Permalink
Merge pull request #205 from alexander-schranz/patch-1
Browse files Browse the repository at this point in the history
Fix query tokenizing on windows
  • Loading branch information
dbu authored Dec 20, 2021
2 parents fccdcab + e690036 commit 361fe27
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
33 changes: 33 additions & 0 deletions .github/workflows/test-application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,36 @@ jobs:

- name: Execute test cases
run: vendor/bin/phpunit

php-windows:
name: "PHP Windows ${{ matrix.php-version }} ${{ matrix.dependencies }} ${{ matrix.dev-dependencies && 'dev' }}"
runs-on: windows-latest

strategy:
fail-fast: false
matrix:
include:
- php-version: '8.1'

steps:
- name: Checkout project
uses: actions/checkout@v2

- name: Install and configure PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
tools: 'composer:v2'

- name: Allow unstable dependencies
if: matrix.dev-dependencies == true
run: composer config minimum-stability dev

- name: Install dependencies with Composer
uses: ramsey/composer-install@v1
with:
dependency-versions: ${{ matrix.dependencies }}
composer-options: --prefer-dist

- name: Execute test cases
run: vendor/bin/phpunit
2 changes: 1 addition & 1 deletion src/PHPCR/Util/QOM/Sql2Scanner.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ protected function scan($sql2)
$splitString = \str_split($sql2);
for ($index = 0; $index < count($splitString); $index++) {
$character = $splitString[$index];
if (!$stringStartCharacter && in_array($character, [' ', "\t", "\n"], true)) {
if (!$stringStartCharacter && in_array($character, [' ', "\t", "\n", "\r"], true)) {
if ($currentToken !== '') {
$tokens[] = $currentToken;
}
Expand Down

0 comments on commit 361fe27

Please sign in to comment.