@@ -30,7 +30,7 @@ public function match($rawPathinfo)
30
30
31
31
if (0 === strpos ($ pathinfo , '/foo ' )) {
32
32
// foo
33
- if (preg_match ('#^/foo/(?P<bar>baz|symfony)$#s ' , $ pathinfo , $ matches )) {
33
+ if (preg_match ('#^/foo/(?P<bar>baz|symfony)$#sD ' , $ pathinfo , $ matches )) {
34
34
return $ this ->mergeDefaults (array_replace ($ matches , array ('_route ' => 'foo ' )), array ( 'def ' => 'test ' ,));
35
35
}
36
36
@@ -43,7 +43,7 @@ public function match($rawPathinfo)
43
43
44
44
elseif (0 === strpos ($ pathinfo , '/bar ' )) {
45
45
// bar
46
- if (preg_match ('#^/bar/(?P<foo>[^/]++)$#s ' , $ pathinfo , $ matches )) {
46
+ if (preg_match ('#^/bar/(?P<foo>[^/]++)$#sD ' , $ pathinfo , $ matches )) {
47
47
if ('GET ' !== $ canonicalMethod ) {
48
48
$ allow [] = 'GET ' ;
49
49
goto not_bar;
@@ -54,7 +54,7 @@ public function match($rawPathinfo)
54
54
not_bar:
55
55
56
56
// barhead
57
- if (0 === strpos ($ pathinfo , '/barhead ' ) && preg_match ('#^/barhead/(?P<foo>[^/]++)$#s ' , $ pathinfo , $ matches )) {
57
+ if (0 === strpos ($ pathinfo , '/barhead ' ) && preg_match ('#^/barhead/(?P<foo>[^/]++)$#sD ' , $ pathinfo , $ matches )) {
58
58
if ('GET ' !== $ canonicalMethod ) {
59
59
$ allow [] = 'GET ' ;
60
60
goto not_barhead;
@@ -86,12 +86,12 @@ public function match($rawPathinfo)
86
86
}
87
87
88
88
// baz4
89
- if (preg_match ('#^/test/(?P<foo>[^/]++)/$#s ' , $ pathinfo , $ matches )) {
89
+ if (preg_match ('#^/test/(?P<foo>[^/]++)/$#sD ' , $ pathinfo , $ matches )) {
90
90
return $ this ->mergeDefaults (array_replace ($ matches , array ('_route ' => 'baz4 ' )), array ());
91
91
}
92
92
93
93
// baz5
94
- if (preg_match ('#^/test/(?P<foo>[^/]++)/$#s ' , $ pathinfo , $ matches )) {
94
+ if (preg_match ('#^/test/(?P<foo>[^/]++)/$#sD ' , $ pathinfo , $ matches )) {
95
95
if ('POST ' !== $ canonicalMethod ) {
96
96
$ allow [] = 'POST ' ;
97
97
goto not_baz5;
@@ -102,7 +102,7 @@ public function match($rawPathinfo)
102
102
not_baz5:
103
103
104
104
// baz.baz6
105
- if (preg_match ('#^/test/(?P<foo>[^/]++)/$#s ' , $ pathinfo , $ matches )) {
105
+ if (preg_match ('#^/test/(?P<foo>[^/]++)/$#sD ' , $ pathinfo , $ matches )) {
106
106
if ('PUT ' !== $ canonicalMethod ) {
107
107
$ allow [] = 'PUT ' ;
108
108
goto not_bazbaz6;
@@ -115,7 +115,7 @@ public function match($rawPathinfo)
115
115
}
116
116
117
117
// quoter
118
- if (preg_match ('#^/(?P<quoter>[ \']+)$#s ' , $ pathinfo , $ matches )) {
118
+ if (preg_match ('#^/(?P<quoter>[ \']+)$#sD ' , $ pathinfo , $ matches )) {
119
119
return $ this ->mergeDefaults (array_replace ($ matches , array ('_route ' => 'quoter ' )), array ());
120
120
}
121
121
@@ -127,30 +127,30 @@ public function match($rawPathinfo)
127
127
if (0 === strpos ($ pathinfo , '/a ' )) {
128
128
if (0 === strpos ($ pathinfo , '/a/b \'b ' )) {
129
129
// foo1
130
- if (preg_match ('#^/a/b \'b/(?P<foo>[^/]++)$#s ' , $ pathinfo , $ matches )) {
130
+ if (preg_match ('#^/a/b \'b/(?P<foo>[^/]++)$#sD ' , $ pathinfo , $ matches )) {
131
131
return $ this ->mergeDefaults (array_replace ($ matches , array ('_route ' => 'foo1 ' )), array ());
132
132
}
133
133
134
134
// bar1
135
- if (preg_match ('#^/a/b \'b/(?P<bar>[^/]++)$#s ' , $ pathinfo , $ matches )) {
135
+ if (preg_match ('#^/a/b \'b/(?P<bar>[^/]++)$#sD ' , $ pathinfo , $ matches )) {
136
136
return $ this ->mergeDefaults (array_replace ($ matches , array ('_route ' => 'bar1 ' )), array ());
137
137
}
138
138
139
139
}
140
140
141
141
// overridden
142
- if (preg_match ('#^/a/(?P<var>.*)$#s ' , $ pathinfo , $ matches )) {
142
+ if (preg_match ('#^/a/(?P<var>.*)$#sD ' , $ pathinfo , $ matches )) {
143
143
return $ this ->mergeDefaults (array_replace ($ matches , array ('_route ' => 'overridden ' )), array ());
144
144
}
145
145
146
146
if (0 === strpos ($ pathinfo , '/a/b \'b ' )) {
147
147
// foo2
148
- if (preg_match ('#^/a/b \'b/(?P<foo1>[^/]++)$#s ' , $ pathinfo , $ matches )) {
148
+ if (preg_match ('#^/a/b \'b/(?P<foo1>[^/]++)$#sD ' , $ pathinfo , $ matches )) {
149
149
return $ this ->mergeDefaults (array_replace ($ matches , array ('_route ' => 'foo2 ' )), array ());
150
150
}
151
151
152
152
// bar2
153
- if (preg_match ('#^/a/b \'b/(?P<bar1>[^/]++)$#s ' , $ pathinfo , $ matches )) {
153
+ if (preg_match ('#^/a/b \'b/(?P<bar1>[^/]++)$#sD ' , $ pathinfo , $ matches )) {
154
154
return $ this ->mergeDefaults (array_replace ($ matches , array ('_route ' => 'bar2 ' )), array ());
155
155
}
156
156
@@ -160,7 +160,7 @@ public function match($rawPathinfo)
160
160
161
161
elseif (0 === strpos ($ pathinfo , '/multi ' )) {
162
162
// helloWorld
163
- if (0 === strpos ($ pathinfo , '/multi/hello ' ) && preg_match ('#^/multi/hello(?:/(?P<who>[^/]++))?$#s ' , $ pathinfo , $ matches )) {
163
+ if (0 === strpos ($ pathinfo , '/multi/hello ' ) && preg_match ('#^/multi/hello(?:/(?P<who>[^/]++))?$#sD ' , $ pathinfo , $ matches )) {
164
164
return $ this ->mergeDefaults (array_replace ($ matches , array ('_route ' => 'helloWorld ' )), array ( 'who ' => 'World! ' ,));
165
165
}
166
166
@@ -177,12 +177,12 @@ public function match($rawPathinfo)
177
177
}
178
178
179
179
// foo3
180
- if (preg_match ('#^/(?P<_locale>[^/]++)/b/(?P<foo>[^/]++)$#s ' , $ pathinfo , $ matches )) {
180
+ if (preg_match ('#^/(?P<_locale>[^/]++)/b/(?P<foo>[^/]++)$#sD ' , $ pathinfo , $ matches )) {
181
181
return $ this ->mergeDefaults (array_replace ($ matches , array ('_route ' => 'foo3 ' )), array ());
182
182
}
183
183
184
184
// bar3
185
- if (preg_match ('#^/(?P<_locale>[^/]++)/b/(?P<bar>[^/]++)$#s ' , $ pathinfo , $ matches )) {
185
+ if (preg_match ('#^/(?P<_locale>[^/]++)/b/(?P<bar>[^/]++)$#sD ' , $ pathinfo , $ matches )) {
186
186
return $ this ->mergeDefaults (array_replace ($ matches , array ('_route ' => 'bar3 ' )), array ());
187
187
}
188
188
@@ -193,15 +193,15 @@ public function match($rawPathinfo)
193
193
}
194
194
195
195
// foo4
196
- if (preg_match ('#^/aba/(?P<foo>[^/]++)$#s ' , $ pathinfo , $ matches )) {
196
+ if (preg_match ('#^/aba/(?P<foo>[^/]++)$#sD ' , $ pathinfo , $ matches )) {
197
197
return $ this ->mergeDefaults (array_replace ($ matches , array ('_route ' => 'foo4 ' )), array ());
198
198
}
199
199
200
200
}
201
201
202
202
$ host = $ context ->getHost ();
203
203
204
- if (preg_match ('#^a \\.example \\.com$#si ' , $ host , $ hostMatches )) {
204
+ if (preg_match ('#^a \\.example \\.com$#sDi ' , $ host , $ hostMatches )) {
205
205
// route1
206
206
if ('/route1 ' === $ pathinfo ) {
207
207
return array ('_route ' => 'route1 ' );
@@ -214,23 +214,23 @@ public function match($rawPathinfo)
214
214
215
215
}
216
216
217
- if (preg_match ('#^b \\.example \\.com$#si ' , $ host , $ hostMatches )) {
217
+ if (preg_match ('#^b \\.example \\.com$#sDi ' , $ host , $ hostMatches )) {
218
218
// route3
219
219
if ('/c2/route3 ' === $ pathinfo ) {
220
220
return array ('_route ' => 'route3 ' );
221
221
}
222
222
223
223
}
224
224
225
- if (preg_match ('#^a \\.example \\.com$#si ' , $ host , $ hostMatches )) {
225
+ if (preg_match ('#^a \\.example \\.com$#sDi ' , $ host , $ hostMatches )) {
226
226
// route4
227
227
if ('/route4 ' === $ pathinfo ) {
228
228
return array ('_route ' => 'route4 ' );
229
229
}
230
230
231
231
}
232
232
233
- if (preg_match ('#^c \\.example \\.com$#si ' , $ host , $ hostMatches )) {
233
+ if (preg_match ('#^c \\.example \\.com$#sDi ' , $ host , $ hostMatches )) {
234
234
// route5
235
235
if ('/route5 ' === $ pathinfo ) {
236
236
return array ('_route ' => 'route5 ' );
@@ -243,7 +243,7 @@ public function match($rawPathinfo)
243
243
return array ('_route ' => 'route6 ' );
244
244
}
245
245
246
- if (preg_match ('#^(?P<var1>[^ \\.]++) \\.example \\.com$#si ' , $ host , $ hostMatches )) {
246
+ if (preg_match ('#^(?P<var1>[^ \\.]++) \\.example \\.com$#sDi ' , $ host , $ hostMatches )) {
247
247
if (0 === strpos ($ pathinfo , '/route1 ' )) {
248
248
// route11
249
249
if ('/route11 ' === $ pathinfo ) {
@@ -256,29 +256,29 @@ public function match($rawPathinfo)
256
256
}
257
257
258
258
// route13
259
- if (0 === strpos ($ pathinfo , '/route13 ' ) && preg_match ('#^/route13/(?P<name>[^/]++)$#s ' , $ pathinfo , $ matches )) {
259
+ if (0 === strpos ($ pathinfo , '/route13 ' ) && preg_match ('#^/route13/(?P<name>[^/]++)$#sD ' , $ pathinfo , $ matches )) {
260
260
return $ this ->mergeDefaults (array_replace ($ hostMatches , $ matches , array ('_route ' => 'route13 ' )), array ());
261
261
}
262
262
263
263
// route14
264
- if (0 === strpos ($ pathinfo , '/route14 ' ) && preg_match ('#^/route14/(?P<name>[^/]++)$#s ' , $ pathinfo , $ matches )) {
264
+ if (0 === strpos ($ pathinfo , '/route14 ' ) && preg_match ('#^/route14/(?P<name>[^/]++)$#sD ' , $ pathinfo , $ matches )) {
265
265
return $ this ->mergeDefaults (array_replace ($ hostMatches , $ matches , array ('_route ' => 'route14 ' )), array ( 'var1 ' => 'val ' ,));
266
266
}
267
267
268
268
}
269
269
270
270
}
271
271
272
- if (preg_match ('#^c \\.example \\.com$#si ' , $ host , $ hostMatches )) {
272
+ if (preg_match ('#^c \\.example \\.com$#sDi ' , $ host , $ hostMatches )) {
273
273
// route15
274
- if (0 === strpos ($ pathinfo , '/route15 ' ) && preg_match ('#^/route15/(?P<name>[^/]++)$#s ' , $ pathinfo , $ matches )) {
274
+ if (0 === strpos ($ pathinfo , '/route15 ' ) && preg_match ('#^/route15/(?P<name>[^/]++)$#sD ' , $ pathinfo , $ matches )) {
275
275
return $ this ->mergeDefaults (array_replace ($ matches , array ('_route ' => 'route15 ' )), array ());
276
276
}
277
277
278
278
}
279
279
280
280
// route16
281
- if (0 === strpos ($ pathinfo , '/route16 ' ) && preg_match ('#^/route16/(?P<name>[^/]++)$#s ' , $ pathinfo , $ matches )) {
281
+ if (0 === strpos ($ pathinfo , '/route16 ' ) && preg_match ('#^/route16/(?P<name>[^/]++)$#sD ' , $ pathinfo , $ matches )) {
282
282
return $ this ->mergeDefaults (array_replace ($ matches , array ('_route ' => 'route16 ' )), array ( 'var1 ' => 'val ' ,));
283
283
}
284
284
@@ -294,12 +294,12 @@ public function match($rawPathinfo)
294
294
295
295
if (0 === strpos ($ pathinfo , '/a/b ' )) {
296
296
// b
297
- if (preg_match ('#^/a/b/(?P<var>[^/]++)$#s ' , $ pathinfo , $ matches )) {
297
+ if (preg_match ('#^/a/b/(?P<var>[^/]++)$#sD ' , $ pathinfo , $ matches )) {
298
298
return $ this ->mergeDefaults (array_replace ($ matches , array ('_route ' => 'b ' )), array ());
299
299
}
300
300
301
301
// c
302
- if (0 === strpos ($ pathinfo , '/a/b/c ' ) && preg_match ('#^/a/b/c/(?P<var>[^/]++)$#s ' , $ pathinfo , $ matches )) {
302
+ if (0 === strpos ($ pathinfo , '/a/b/c ' ) && preg_match ('#^/a/b/c/(?P<var>[^/]++)$#sD ' , $ pathinfo , $ matches )) {
303
303
return $ this ->mergeDefaults (array_replace ($ matches , array ('_route ' => 'c ' )), array ());
304
304
}
305
305
0 commit comments