File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -104,7 +104,7 @@ public function parse($query)
104104
105105 $ this ->notParsedQuery = $ query ;
106106
107- // Getting query parts
107+ // Getting query's parts
108108 $ queryParts = explode ('. ' , $ this ->notParsedQuery );
109109
110110 // Getting the table name
@@ -113,6 +113,13 @@ public function parse($query)
113113 throw new Exception ('JSONDB Query Parse Error: No table detected in the query. ' );
114114 }
115115
116+ // Checking query's parts validity
117+ foreach (array_slice ($ queryParts , 1 ) as $ part ) {
118+ if (FALSE === (bool )preg_match ('#\w+\(.*\)# ' , $ part )) {
119+ throw new Exception ("JSONDB Query Parse Error: There is an error at the extension \"{$ part }\". " );
120+ }
121+ }
122+
116123 // Getting the query's main action
117124 $ this ->parsedQuery ['action ' ] = preg_replace ('#\(.*\)# ' , '' , $ queryParts [1 ]);
118125 if (!in_array (strtolower ($ this ->parsedQuery ['action ' ]), self ::$ supportedQueries , TRUE )) {
You can’t perform that action at this time.
0 commit comments