From 1e2b8c61cc8c8df4ec5df89badcaae715bffd1c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Tue, 14 Feb 2023 13:51:39 +0100 Subject: [PATCH] Add proper bracing around if-clause php is not Python, and the indentation is meaningless for code-blocks. Closes: https://github.com/joshp23/YOURLS-AuthMgrPlus/issues/55 --- authMgrPlus/plugin.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/authMgrPlus/plugin.php b/authMgrPlus/plugin.php index a59ffe7..567c14f 100644 --- a/authMgrPlus/plugin.php +++ b/authMgrPlus/plugin.php @@ -268,11 +268,11 @@ function amp_have_capability( $capability ) { // List capabilities of particular user role $user = defined('YOURLS_USER') ? YOURLS_USER : NULL; $user_caps = array(); - if ( amp_user_is_assigned ( $user ) ) + if ( amp_user_is_assigned ( $user ) ) { foreach ( $amp_role_capabilities as $rolename => $rolecaps ) if ( amp_user_has_role( $user, $rolename ) ) $user_caps = array_merge( $user_caps, $rolecaps ); - + } elseif ( isset( $amp_default_role ) && in_array ($amp_default_role, array_keys( $amp_role_capabilities ) ) ) $user_caps = $amp_role_capabilities [ $amp_default_role ];