File tree Expand file tree Collapse file tree 2 files changed +18
-4
lines changed Expand file tree Collapse file tree 2 files changed +18
-4
lines changed Original file line number Diff line number Diff line change @@ -205,7 +205,7 @@ public function test_ajax_default()
205
205
'autocomplete ' => [
206
206
'mininput ' => 2 ,
207
207
'maxresult ' => 5 ,
208
- 'namespace ' => '' ,
208
+ 'filter ' => '' ,
209
209
'postfix ' => '' ,
210
210
],
211
211
]
@@ -238,6 +238,10 @@ public function test_ajax_default()
238
238
], $ page ->handleAjax ());
239
239
}
240
240
241
+ /**
242
+ * Test deprecated option namespace
243
+ * @return void
244
+ */
241
245
public function test_ajax_namespace ()
242
246
{
243
247
global $ INPUT ;
@@ -257,7 +261,7 @@ public function test_ajax_namespace()
257
261
$ this ->assertEquals ([['label ' => 'syntax (wiki) ' , 'value ' => 'wiki:syntax ' ]], $ page ->handleAjax ());
258
262
}
259
263
260
- public function test_ajax_namespace_multiple ()
264
+ public function test_ajax_filter_multiple ()
261
265
{
262
266
global $ INPUT ;
263
267
@@ -266,7 +270,7 @@ public function test_ajax_namespace_multiple()
266
270
'autocomplete ' => [
267
271
'mininput ' => 2 ,
268
272
'maxresult ' => 5 ,
269
- 'namespace ' => '(wiki|foo) ' ,
273
+ 'filter ' => '(wiki|foo) ' ,
270
274
'postfix ' => '' ,
271
275
],
272
276
]
@@ -279,6 +283,10 @@ public function test_ajax_namespace_multiple()
279
283
], $ page ->handleAjax ());
280
284
}
281
285
286
+ /**
287
+ * Test deprecated option postfix
288
+ * @return void
289
+ */
282
290
public function test_ajax_postfix ()
283
291
{
284
292
global $ INPUT ;
Original file line number Diff line number Diff line change 5
5
use dokuwiki \File \PageResolver ;
6
6
use dokuwiki \plugin \struct \meta \QueryBuilder ;
7
7
use dokuwiki \plugin \struct \meta \QueryBuilderWhere ;
8
+ use dokuwiki \plugin \struct \meta \StructException ;
8
9
use dokuwiki \Utf8 \PhpString ;
9
10
10
11
/**
@@ -256,7 +257,12 @@ public function filterMatch($id, $filter)
256
257
$ filter = '^ ' . $ filter ;
257
258
}
258
259
259
- return (bool )preg_match ('/ ' . $ filter . '/ ' , ': ' . $ id , $ matches );
260
+ try {
261
+ $ check = preg_match ('/ ' . $ filter . '/ ' , ': ' . $ id , $ matches );
262
+ } catch (\Exception $ e ) {
263
+ throw new StructException ("Error processing regular expression ' $ filter' " );
264
+ }
265
+ return (bool )$ check ;
260
266
}
261
267
262
268
/**
You can’t perform that action at this time.
0 commit comments