@@ -23,13 +23,13 @@ public function match($rawPathinfo)
23
23
$ request = $ this ->request ?: $ this ->createRequest ($ pathinfo );
24
24
25
25
// foo
26
- if (0 === strpos ($ pathinfo , '/foo ' ) && preg_match ('#^/foo/(?P<bar>baz|symfony)$#s ' , $ pathinfo , $ matches )) {
26
+ if (0 === strpos ($ pathinfo , '/foo ' ) && preg_match ('#^/foo/(?P<bar>baz|symfony)$#sD ' , $ pathinfo , $ matches )) {
27
27
return $ this ->mergeDefaults (array_replace ($ matches , array ('_route ' => 'foo ' )), array ( 'def ' => 'test ' ,));
28
28
}
29
29
30
30
if (0 === strpos ($ pathinfo , '/bar ' )) {
31
31
// bar
32
- if (preg_match ('#^/bar/(?P<foo>[^/]++)$#s ' , $ pathinfo , $ matches )) {
32
+ if (preg_match ('#^/bar/(?P<foo>[^/]++)$#sD ' , $ pathinfo , $ matches )) {
33
33
if (!in_array ($ this ->context ->getMethod (), array ('GET ' , 'HEAD ' ))) {
34
34
$ allow = array_merge ($ allow , array ('GET ' , 'HEAD ' ));
35
35
goto not_bar;
@@ -40,7 +40,7 @@ public function match($rawPathinfo)
40
40
not_bar:
41
41
42
42
// barhead
43
- if (0 === strpos ($ pathinfo , '/barhead ' ) && preg_match ('#^/barhead/(?P<foo>[^/]++)$#s ' , $ pathinfo , $ matches )) {
43
+ if (0 === strpos ($ pathinfo , '/barhead ' ) && preg_match ('#^/barhead/(?P<foo>[^/]++)$#sD ' , $ pathinfo , $ matches )) {
44
44
if (!in_array ($ this ->context ->getMethod (), array ('GET ' , 'HEAD ' ))) {
45
45
$ allow = array_merge ($ allow , array ('GET ' , 'HEAD ' ));
46
46
goto not_barhead;
@@ -72,12 +72,12 @@ public function match($rawPathinfo)
72
72
}
73
73
74
74
// baz4
75
- if (preg_match ('#^/test/(?P<foo>[^/]++)/$#s ' , $ pathinfo , $ matches )) {
75
+ if (preg_match ('#^/test/(?P<foo>[^/]++)/$#sD ' , $ pathinfo , $ matches )) {
76
76
return $ this ->mergeDefaults (array_replace ($ matches , array ('_route ' => 'baz4 ' )), array ());
77
77
}
78
78
79
79
// baz5
80
- if (preg_match ('#^/test/(?P<foo>[^/]++)/$#s ' , $ pathinfo , $ matches )) {
80
+ if (preg_match ('#^/test/(?P<foo>[^/]++)/$#sD ' , $ pathinfo , $ matches )) {
81
81
if ($ this ->context ->getMethod () != 'POST ' ) {
82
82
$ allow [] = 'POST ' ;
83
83
goto not_baz5;
@@ -88,7 +88,7 @@ public function match($rawPathinfo)
88
88
not_baz5:
89
89
90
90
// baz.baz6
91
- if (preg_match ('#^/test/(?P<foo>[^/]++)/$#s ' , $ pathinfo , $ matches )) {
91
+ if (preg_match ('#^/test/(?P<foo>[^/]++)/$#sD ' , $ pathinfo , $ matches )) {
92
92
if ($ this ->context ->getMethod () != 'PUT ' ) {
93
93
$ allow [] = 'PUT ' ;
94
94
goto not_bazbaz6;
@@ -106,7 +106,7 @@ public function match($rawPathinfo)
106
106
}
107
107
108
108
// quoter
109
- if (preg_match ('#^/(?P<quoter>[ \']+)$#s ' , $ pathinfo , $ matches )) {
109
+ if (preg_match ('#^/(?P<quoter>[ \']+)$#sD ' , $ pathinfo , $ matches )) {
110
110
return $ this ->mergeDefaults (array_replace ($ matches , array ('_route ' => 'quoter ' )), array ());
111
111
}
112
112
@@ -118,30 +118,30 @@ public function match($rawPathinfo)
118
118
if (0 === strpos ($ pathinfo , '/a ' )) {
119
119
if (0 === strpos ($ pathinfo , '/a/b \'b ' )) {
120
120
// foo1
121
- if (preg_match ('#^/a/b \'b/(?P<foo>[^/]++)$#s ' , $ pathinfo , $ matches )) {
121
+ if (preg_match ('#^/a/b \'b/(?P<foo>[^/]++)$#sD ' , $ pathinfo , $ matches )) {
122
122
return $ this ->mergeDefaults (array_replace ($ matches , array ('_route ' => 'foo1 ' )), array ());
123
123
}
124
124
125
125
// bar1
126
- if (preg_match ('#^/a/b \'b/(?P<bar>[^/]++)$#s ' , $ pathinfo , $ matches )) {
126
+ if (preg_match ('#^/a/b \'b/(?P<bar>[^/]++)$#sD ' , $ pathinfo , $ matches )) {
127
127
return $ this ->mergeDefaults (array_replace ($ matches , array ('_route ' => 'bar1 ' )), array ());
128
128
}
129
129
130
130
}
131
131
132
132
// overridden
133
- if (preg_match ('#^/a/(?P<var>.*)$#s ' , $ pathinfo , $ matches )) {
133
+ if (preg_match ('#^/a/(?P<var>.*)$#sD ' , $ pathinfo , $ matches )) {
134
134
return $ this ->mergeDefaults (array_replace ($ matches , array ('_route ' => 'overridden ' )), array ());
135
135
}
136
136
137
137
if (0 === strpos ($ pathinfo , '/a/b \'b ' )) {
138
138
// foo2
139
- if (preg_match ('#^/a/b \'b/(?P<foo1>[^/]++)$#s ' , $ pathinfo , $ matches )) {
139
+ if (preg_match ('#^/a/b \'b/(?P<foo1>[^/]++)$#sD ' , $ pathinfo , $ matches )) {
140
140
return $ this ->mergeDefaults (array_replace ($ matches , array ('_route ' => 'foo2 ' )), array ());
141
141
}
142
142
143
143
// bar2
144
- if (preg_match ('#^/a/b \'b/(?P<bar1>[^/]++)$#s ' , $ pathinfo , $ matches )) {
144
+ if (preg_match ('#^/a/b \'b/(?P<bar1>[^/]++)$#sD ' , $ pathinfo , $ matches )) {
145
145
return $ this ->mergeDefaults (array_replace ($ matches , array ('_route ' => 'bar2 ' )), array ());
146
146
}
147
147
@@ -151,7 +151,7 @@ public function match($rawPathinfo)
151
151
152
152
if (0 === strpos ($ pathinfo , '/multi ' )) {
153
153
// helloWorld
154
- if (0 === strpos ($ pathinfo , '/multi/hello ' ) && preg_match ('#^/multi/hello(?:/(?P<who>[^/]++))?$#s ' , $ pathinfo , $ matches )) {
154
+ if (0 === strpos ($ pathinfo , '/multi/hello ' ) && preg_match ('#^/multi/hello(?:/(?P<who>[^/]++))?$#sD ' , $ pathinfo , $ matches )) {
155
155
return $ this ->mergeDefaults (array_replace ($ matches , array ('_route ' => 'helloWorld ' )), array ( 'who ' => 'World! ' ,));
156
156
}
157
157
@@ -168,12 +168,12 @@ public function match($rawPathinfo)
168
168
}
169
169
170
170
// foo3
171
- if (preg_match ('#^/(?P<_locale>[^/]++)/b/(?P<foo>[^/]++)$#s ' , $ pathinfo , $ matches )) {
171
+ if (preg_match ('#^/(?P<_locale>[^/]++)/b/(?P<foo>[^/]++)$#sD ' , $ pathinfo , $ matches )) {
172
172
return $ this ->mergeDefaults (array_replace ($ matches , array ('_route ' => 'foo3 ' )), array ());
173
173
}
174
174
175
175
// bar3
176
- if (preg_match ('#^/(?P<_locale>[^/]++)/b/(?P<bar>[^/]++)$#s ' , $ pathinfo , $ matches )) {
176
+ if (preg_match ('#^/(?P<_locale>[^/]++)/b/(?P<bar>[^/]++)$#sD ' , $ pathinfo , $ matches )) {
177
177
return $ this ->mergeDefaults (array_replace ($ matches , array ('_route ' => 'bar3 ' )), array ());
178
178
}
179
179
@@ -184,15 +184,15 @@ public function match($rawPathinfo)
184
184
}
185
185
186
186
// foo4
187
- if (preg_match ('#^/aba/(?P<foo>[^/]++)$#s ' , $ pathinfo , $ matches )) {
187
+ if (preg_match ('#^/aba/(?P<foo>[^/]++)$#sD ' , $ pathinfo , $ matches )) {
188
188
return $ this ->mergeDefaults (array_replace ($ matches , array ('_route ' => 'foo4 ' )), array ());
189
189
}
190
190
191
191
}
192
192
193
193
$ host = $ this ->context ->getHost ();
194
194
195
- if (preg_match ('#^a \\.example \\.com$#si ' , $ host , $ hostMatches )) {
195
+ if (preg_match ('#^a \\.example \\.com$#sDi ' , $ host , $ hostMatches )) {
196
196
// route1
197
197
if ('/route1 ' === $ pathinfo ) {
198
198
return array ('_route ' => 'route1 ' );
@@ -205,23 +205,23 @@ public function match($rawPathinfo)
205
205
206
206
}
207
207
208
- if (preg_match ('#^b \\.example \\.com$#si ' , $ host , $ hostMatches )) {
208
+ if (preg_match ('#^b \\.example \\.com$#sDi ' , $ host , $ hostMatches )) {
209
209
// route3
210
210
if ('/c2/route3 ' === $ pathinfo ) {
211
211
return array ('_route ' => 'route3 ' );
212
212
}
213
213
214
214
}
215
215
216
- if (preg_match ('#^a \\.example \\.com$#si ' , $ host , $ hostMatches )) {
216
+ if (preg_match ('#^a \\.example \\.com$#sDi ' , $ host , $ hostMatches )) {
217
217
// route4
218
218
if ('/route4 ' === $ pathinfo ) {
219
219
return array ('_route ' => 'route4 ' );
220
220
}
221
221
222
222
}
223
223
224
- if (preg_match ('#^c \\.example \\.com$#si ' , $ host , $ hostMatches )) {
224
+ if (preg_match ('#^c \\.example \\.com$#sDi ' , $ host , $ hostMatches )) {
225
225
// route5
226
226
if ('/route5 ' === $ pathinfo ) {
227
227
return array ('_route ' => 'route5 ' );
@@ -234,7 +234,7 @@ public function match($rawPathinfo)
234
234
return array ('_route ' => 'route6 ' );
235
235
}
236
236
237
- if (preg_match ('#^(?P<var1>[^ \\.]++) \\.example \\.com$#si ' , $ host , $ hostMatches )) {
237
+ if (preg_match ('#^(?P<var1>[^ \\.]++) \\.example \\.com$#sDi ' , $ host , $ hostMatches )) {
238
238
if (0 === strpos ($ pathinfo , '/route1 ' )) {
239
239
// route11
240
240
if ('/route11 ' === $ pathinfo ) {
@@ -247,30 +247,30 @@ public function match($rawPathinfo)
247
247
}
248
248
249
249
// route13
250
- if (0 === strpos ($ pathinfo , '/route13 ' ) && preg_match ('#^/route13/(?P<name>[^/]++)$#s ' , $ pathinfo , $ matches )) {
250
+ if (0 === strpos ($ pathinfo , '/route13 ' ) && preg_match ('#^/route13/(?P<name>[^/]++)$#sD ' , $ pathinfo , $ matches )) {
251
251
return $ this ->mergeDefaults (array_replace ($ hostMatches , $ matches , array ('_route ' => 'route13 ' )), array ());
252
252
}
253
253
254
254
// route14
255
- if (0 === strpos ($ pathinfo , '/route14 ' ) && preg_match ('#^/route14/(?P<name>[^/]++)$#s ' , $ pathinfo , $ matches )) {
255
+ if (0 === strpos ($ pathinfo , '/route14 ' ) && preg_match ('#^/route14/(?P<name>[^/]++)$#sD ' , $ pathinfo , $ matches )) {
256
256
return $ this ->mergeDefaults (array_replace ($ hostMatches , $ matches , array ('_route ' => 'route14 ' )), array ( 'var1 ' => 'val ' ,));
257
257
}
258
258
259
259
}
260
260
261
261
}
262
262
263
- if (preg_match ('#^c \\.example \\.com$#si ' , $ host , $ hostMatches )) {
263
+ if (preg_match ('#^c \\.example \\.com$#sDi ' , $ host , $ hostMatches )) {
264
264
// route15
265
- if (0 === strpos ($ pathinfo , '/route15 ' ) && preg_match ('#^/route15/(?P<name>[^/]++)$#s ' , $ pathinfo , $ matches )) {
265
+ if (0 === strpos ($ pathinfo , '/route15 ' ) && preg_match ('#^/route15/(?P<name>[^/]++)$#sD ' , $ pathinfo , $ matches )) {
266
266
return $ this ->mergeDefaults (array_replace ($ matches , array ('_route ' => 'route15 ' )), array ());
267
267
}
268
268
269
269
}
270
270
271
271
if (0 === strpos ($ pathinfo , '/route1 ' )) {
272
272
// route16
273
- if (0 === strpos ($ pathinfo , '/route16 ' ) && preg_match ('#^/route16/(?P<name>[^/]++)$#s ' , $ pathinfo , $ matches )) {
273
+ if (0 === strpos ($ pathinfo , '/route16 ' ) && preg_match ('#^/route16/(?P<name>[^/]++)$#sD ' , $ pathinfo , $ matches )) {
274
274
return $ this ->mergeDefaults (array_replace ($ matches , array ('_route ' => 'route16 ' )), array ( 'var1 ' => 'val ' ,));
275
275
}
276
276
@@ -289,12 +289,12 @@ public function match($rawPathinfo)
289
289
290
290
if (0 === strpos ($ pathinfo , '/a/b ' )) {
291
291
// b
292
- if (preg_match ('#^/a/b/(?P<var>[^/]++)$#s ' , $ pathinfo , $ matches )) {
292
+ if (preg_match ('#^/a/b/(?P<var>[^/]++)$#sD ' , $ pathinfo , $ matches )) {
293
293
return $ this ->mergeDefaults (array_replace ($ matches , array ('_route ' => 'b ' )), array ());
294
294
}
295
295
296
296
// c
297
- if (0 === strpos ($ pathinfo , '/a/b/c ' ) && preg_match ('#^/a/b/c/(?P<var>[^/]++)$#s ' , $ pathinfo , $ matches )) {
297
+ if (0 === strpos ($ pathinfo , '/a/b/c ' ) && preg_match ('#^/a/b/c/(?P<var>[^/]++)$#sD ' , $ pathinfo , $ matches )) {
298
298
return $ this ->mergeDefaults (array_replace ($ matches , array ('_route ' => 'c ' )), array ());
299
299
}
300
300
0 commit comments