@@ -1116,7 +1116,7 @@ public function hasDuration()
11161116
11171117 public function getQueryableValue (string $ field )
11181118 {
1119- if (method_exists ($ this , $ method = Str::camel ($ field ))) {
1119+ if (method_exists ($ this , $ method = Str::camel ($ field )) && $ this -> methodIsSafeToQuery ( $ method ) ) {
11201120 return $ this ->{$ method }();
11211121 }
11221122
@@ -1129,6 +1129,17 @@ public function getQueryableValue(string $field)
11291129 return $ field ->fieldtype ()->toQueryableValue ($ value );
11301130 }
11311131
1132+ private function methodIsSafeToQuery (string $ method ): bool
1133+ {
1134+ return in_array ($ method , [
1135+ 'id ' , 'path ' , 'folder ' , 'filename ' , 'basename ' , 'extension ' ,
1136+ 'blueprint ' , 'container ' , 'containerId ' , 'containerHandle ' ,
1137+ 'size ' , 'lastModified ' , 'mimeType ' ,
1138+ 'width ' , 'height ' , 'orientation ' , 'ratio ' , 'duration ' ,
1139+ 'isImage ' , 'isVideo ' , 'isAudio ' , 'isSvg ' , 'isMedia ' , 'isPdf ' ,
1140+ ]);
1141+ }
1142+
11321143 public function getCurrentDirtyStateAttributes (): array
11331144 {
11341145 return array_merge ([
0 commit comments