File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -1513,12 +1513,17 @@ protected function _check_access()
15131513 return true ;
15141514 }
15151515
1516- $ controller = explode ('/ ' , $ this ->uri ->uri_string ());
1516+ // Fetch controller based on path and controller name
1517+ $ controller = implode ( '/ ' , array ($ this ->router ->fetch_directory (), $ this ->router ->fetch_class ()) );
1518+
1519+ // Remove any double slashes for safety
1520+ $ controller = str_replace ('// ' , '/ ' , $ controller );
15171521
1522+ // Build access table query
15181523 $ this ->rest ->db ->select ();
15191524 $ this ->rest ->db ->where ('key ' , $ this ->rest ->key );
1520- $ this ->rest ->db ->where ('controller ' , $ controller[ 0 ] );
1521-
1525+ $ this ->rest ->db ->where ('controller ' , $ controller );
1526+
15221527 $ query = $ this ->rest ->db ->get (config_item ('rest_access_table ' ));
15231528
15241529 if ($ query ->num_rows > 0 ) {
You can’t perform that action at this time.
0 commit comments