Skip to content

Commit 361fe27

Browse files
authored
Merge pull request #205 from alexander-schranz/patch-1
Fix query tokenizing on windows
2 parents fccdcab + e690036 commit 361fe27

File tree

2 files changed

+34
-1
lines changed

2 files changed

+34
-1
lines changed

.github/workflows/test-application.yaml

+33
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,36 @@ jobs:
5050

5151
- name: Execute test cases
5252
run: vendor/bin/phpunit
53+
54+
php-windows:
55+
name: "PHP Windows ${{ matrix.php-version }} ${{ matrix.dependencies }} ${{ matrix.dev-dependencies && 'dev' }}"
56+
runs-on: windows-latest
57+
58+
strategy:
59+
fail-fast: false
60+
matrix:
61+
include:
62+
- php-version: '8.1'
63+
64+
steps:
65+
- name: Checkout project
66+
uses: actions/checkout@v2
67+
68+
- name: Install and configure PHP
69+
uses: shivammathur/setup-php@v2
70+
with:
71+
php-version: ${{ matrix.php-version }}
72+
tools: 'composer:v2'
73+
74+
- name: Allow unstable dependencies
75+
if: matrix.dev-dependencies == true
76+
run: composer config minimum-stability dev
77+
78+
- name: Install dependencies with Composer
79+
uses: ramsey/composer-install@v1
80+
with:
81+
dependency-versions: ${{ matrix.dependencies }}
82+
composer-options: --prefer-dist
83+
84+
- name: Execute test cases
85+
run: vendor/bin/phpunit

src/PHPCR/Util/QOM/Sql2Scanner.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ protected function scan($sql2)
152152
$splitString = \str_split($sql2);
153153
for ($index = 0; $index < count($splitString); $index++) {
154154
$character = $splitString[$index];
155-
if (!$stringStartCharacter && in_array($character, [' ', "\t", "\n"], true)) {
155+
if (!$stringStartCharacter && in_array($character, [' ', "\t", "\n", "\r"], true)) {
156156
if ($currentToken !== '') {
157157
$tokens[] = $currentToken;
158158
}

0 commit comments

Comments
 (0)