Zotlabs\Extend\Route: Set method visibility

Make `Route::set()` private. It is not referenced outside of the class
itself, and is also unsafe as it uncritically replaces the system routes
with whatever value it was passed.

The remaining functions are set to public visibility.
This commit is contained in:
Harald Eilertsen
2026-03-25 12:45:44 +01:00
parent 016a11ad27
commit 7d70f2f0f2

View File

@@ -65,7 +65,7 @@ class Route {
* @see {@link Zotlabs::Extend::Route.unregister() unregister()}
* @see {@link Zotlabs::Extend::Route.unregister_by_file() unregister_by_file()}
*/
static function register($file,$modname) {
public static function register($file,$modname) {
$rt = self::get();
foreach ($rt as $r) {
@@ -95,7 +95,7 @@ class Route {
* @see {@link Zotlabs::Extend::Route.register() register()}
* @see {@link Zotlabs::Extend::Route.unregister_by_file() unregister_by_file()}
*/
static function unregister($file,$modname) {
public static function unregister($file,$modname) {
$rt = self::get();
if($rt) {
$n = [];
@@ -124,7 +124,7 @@ class Route {
* @see {@link Zotlabs::Extend::Route.register() register()}
* @see {@link Zotlabs::Extend::Route.unregister() unregister()}
*/
static function unregister_by_file($file) {
public static function unregister_by_file($file) {
$rt = self::get();
if($rt) {
$n = [];
@@ -144,11 +144,11 @@ class Route {
* containing two elements, the file, and the module
* name.
*/
static function get() {
public static function get() {
return Config::Get('system','routes',[]);
}
static function set($r) {
private static function set($r) {
return Config::Set('system','routes',$r);
}
}