File tree Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -220,16 +220,18 @@ public function buildSchema()
220
220
221
221
$ known_itemtypes = [];
222
222
preg_match ('/\^\((.+)\)\$/ ' , $ schema ->properties ->itemtype ->pattern , $ known_itemtypes );
223
- $ known_itemtypes = explode ('| ' , $ known_itemtypes [1 ]);
224
- foreach ($ this ->extra_itemtypes as $ extra_itemtype ) {
225
- if (!in_array ($ extra_itemtype , $ known_itemtypes )) {
226
- $ known_itemtypes [] = addslashes ($ extra_itemtype );
223
+ if (isset ($ known_itemtypes [1 ])) {
224
+ $ known_itemtypes = explode ('| ' , $ known_itemtypes [1 ]);
225
+ foreach ($ this ->extra_itemtypes as $ extra_itemtype ) {
226
+ if (!in_array ($ extra_itemtype , $ known_itemtypes )) {
227
+ $ known_itemtypes [] = addslashes ($ extra_itemtype );
228
+ }
227
229
}
230
+ $ schema ->properties ->itemtype ->pattern = sprintf (
231
+ '^(%s)$ ' ,
232
+ implode ('| ' , $ known_itemtypes )
233
+ );
228
234
}
229
- $ schema ->properties ->itemtype ->pattern = sprintf (
230
- '^(%s)$ ' ,
231
- implode ('| ' , $ known_itemtypes )
232
- );
233
235
234
236
$ properties = $ schema ->properties ->content ->properties ;
235
237
You can’t perform that action at this time.
0 commit comments