Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix network role mapping #93

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions inc/namespace.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
/*

Check failure on line 2 in inc/namespace.php

View check run for this annotation

HM Linter / hmlinter

inc/namespace.php#L2

You must use "/**" style comments for a file comment
Raw output
{
  "line": 2,
  "column": 1,
  "severity": "error",
  "message": "You must use \"/**\" style comments for a file comment",
  "source": "Squiz.Commenting.FileComment.WrongStyle"
}
Plugin Name: WP Simple SAML
Description: Integrate SAML 2.0 IDP without the hassle
Author: Shady Sharaf, Human Made
Expand Down Expand Up @@ -57,7 +57,7 @@

// is_plugin_active_for_network can only be used once the plugin.php file is
// included. More information can be found here:
// https://codex.wordpress.org/Function_Reference/is_plugin_active_for_network

Check failure on line 60 in inc/namespace.php

View check run for this annotation

HM Linter / hmlinter

inc/namespace.php#L60

Inline comments must end in full-stops, exclamation marks, or question marks
Raw output
{
  "line": 60,
  "column": 5,
  "severity": "error",
  "message": "Inline comments must end in full-stops, exclamation marks, or question marks",
  "source": "Squiz.Commenting.InlineComment.InvalidEndChar"
}
if ( ! function_exists( 'is_plugin_active_for_network' ) ) {
require_once( ABSPATH . '/wp-admin/includes/plugin.php' );
}
Expand All @@ -71,10 +71,10 @@
function rewrites() {
add_rewrite_endpoint( 'sso', EP_ROOT, true );

// Attempt to flush rewrite rules on plugin activation, not perfect but it should work at least the first time

Check failure on line 74 in inc/namespace.php

View check run for this annotation

HM Linter / hmlinter

inc/namespace.php#L74

Inline comments must end in full-stops, exclamation marks, or question marks
Raw output
{
  "line": 74,
  "column": 5,
  "severity": "error",
  "message": "Inline comments must end in full-stops, exclamation marks, or question marks",
  "source": "Squiz.Commenting.InlineComment.InvalidEndChar"
}
if ( ! get_option( 'wpsimplesaml_rr_flushed' ) ) {
flush_rewrite_rules();
do_action( 'rri_flush_rules' ); // Proper flushing on VIP environments

Check failure on line 77 in inc/namespace.php

View check run for this annotation

HM Linter / hmlinter

inc/namespace.php#L77

Inline comments must end in full-stops, exclamation marks, or question marks
Raw output
{
  "line": 77,
  "column": 41,
  "severity": "error",
  "message": "Inline comments must end in full-stops, exclamation marks, or question marks",
  "source": "Squiz.Commenting.InlineComment.InvalidEndChar"
}
add_option( 'wpsimplesaml_rr_flushed', true );
}
}
Expand All @@ -87,7 +87,7 @@
function endpoint() {
global $wp_query;

// Do not block access to SSO endpoint if blog is not public

Check failure on line 90 in inc/namespace.php

View check run for this annotation

HM Linter / hmlinter

inc/namespace.php#L90

Inline comments must end in full-stops, exclamation marks, or question marks
Raw output
{
  "line": 90,
  "column": 5,
  "severity": "error",
  "message": "Inline comments must end in full-stops, exclamation marks, or question marks",
  "source": "Squiz.Commenting.InlineComment.InvalidEndChar"
}
if ( class_exists( 'ds_more_privacy_options' ) ) {
global $ds_more_privacy_options; // @codingStandardsIgnoreLine
remove_action( 'template_redirect', [ $ds_more_privacy_options, 'ds_users_authenticator' ] );
Expand All @@ -97,7 +97,7 @@
return;
}

// If we have no valid instance, bail completely

Check failure on line 100 in inc/namespace.php

View check run for this annotation

HM Linter / hmlinter

inc/namespace.php#L100

Inline comments must end in full-stops, exclamation marks, or question marks
Raw output
{
  "line": 100,
  "column": 5,
  "severity": "error",
  "message": "Inline comments must end in full-stops, exclamation marks, or question marks",
  "source": "Squiz.Commenting.InlineComment.InvalidEndChar"
}
if ( ! instance() ) {
wp_die( esc_html__( 'Invalid SSO settings. Contact your administrator.', 'wp-simple-saml' ) );
}
Expand All @@ -107,7 +107,7 @@

do_action( 'wpsimplesaml_action_' . $action );

// If nothing happens,

Check failure on line 110 in inc/namespace.php

View check run for this annotation

HM Linter / hmlinter

inc/namespace.php#L110

Inline comments must end in full-stops, exclamation marks, or question marks
Raw output
{
  "line": 110,
  "column": 5,
  "severity": "error",
  "message": "Inline comments must end in full-stops, exclamation marks, or question marks",
  "source": "Squiz.Commenting.InlineComment.InvalidEndChar"
}
do_action( 'wpsimplesaml_invalid_endpoint', $action );
// i haz no monies!
wp_safe_redirect( home_url(), 404 );
Expand Down Expand Up @@ -143,7 +143,7 @@
esc_html( apply_filters( 'wpsimplesaml_log_in_text', __( 'SSO Login', 'wp-simple-saml' ) ) )
);

echo $output; // WPCS: xss ok

Check failure on line 146 in inc/namespace.php

View check run for this annotation

HM Linter / hmlinter

inc/namespace.php#L146

Using the WPCS native whitelist comments is deprecated. Please use the PHPCS native "phpcs:ignore Standard.Category.SniffName.ErrorCode" annotations instead. Found: // WPCS: xss ok\n
Raw output
{
  "line": 146,
  "column": 19,
  "severity": "error",
  "message": "Using the WPCS native whitelist comments is deprecated. Please use the PHPCS native \"phpcs:ignore Standard.Category.SniffName.ErrorCode\" annotations instead. Found: // WPCS: xss ok\\n",
  "source": "HM.Security.EscapeOutput.DeprecatedWhitelistCommentFound"
}

Check failure on line 146 in inc/namespace.php

View check run for this annotation

HM Linter / hmlinter

inc/namespace.php#L146

Inline comments must end in full-stops, exclamation marks, or question marks
Raw output
{
  "line": 146,
  "column": 19,
  "severity": "error",
  "message": "Inline comments must end in full-stops, exclamation marks, or question marks",
  "source": "Squiz.Commenting.InlineComment.InvalidEndChar"
}
}

/**
Expand All @@ -161,7 +161,7 @@
return;
}

// Bail if no SAML2_Auth instance is available, mainly if no configuration was found

Check failure on line 164 in inc/namespace.php

View check run for this annotation

HM Linter / hmlinter

inc/namespace.php#L164

Inline comments must end in full-stops, exclamation marks, or question marks
Raw output
{
  "line": 164,
  "column": 5,
  "severity": "error",
  "message": "Inline comments must end in full-stops, exclamation marks, or question marks",
  "source": "Squiz.Commenting.InlineComment.InvalidEndChar"
}
if ( ! instance() ) {
return;
}
Expand Down Expand Up @@ -259,10 +259,10 @@

$user = get_sso_user();
if ( is_a( $user, 'WP_User' ) ) {
// Set authentication cookie

Check failure on line 262 in inc/namespace.php

View check run for this annotation

HM Linter / hmlinter

inc/namespace.php#L262

Inline comments must end in full-stops, exclamation marks, or question marks
Raw output
{
  "line": 262,
  "column": 9,
  "severity": "error",
  "message": "Inline comments must end in full-stops, exclamation marks, or question marks",
  "source": "Squiz.Commenting.InlineComment.InvalidEndChar"
}
signon( $user );

// Check if we need to add the user to the site if he's not there already

Check failure on line 265 in inc/namespace.php

View check run for this annotation

HM Linter / hmlinter

inc/namespace.php#L265

Inline comments must end in full-stops, exclamation marks, or question marks
Raw output
{
  "line": 265,
  "column": 9,
  "severity": "error",
  "message": "Inline comments must end in full-stops, exclamation marks, or question marks",
  "source": "Squiz.Commenting.InlineComment.InvalidEndChar"
}
if ( ! is_user_member_of_blog( $user->ID, get_current_blog_id() ) ) {
/**
* Filters whether users should be added to sites they've not initially signed in to
Expand Down Expand Up @@ -328,7 +328,7 @@
exit;
}

/**

Check failure on line 331 in inc/namespace.php

View check run for this annotation

HM Linter / hmlinter

inc/namespace.php#L331

Missing short description in doc comment
Raw output
{
  "line": 331,
  "column": 1,
  "severity": "error",
  "message": "Missing short description in doc comment",
  "source": "Generic.Commenting.DocComment.MissingShort"
}
* @return Auth|\WP_Error
*/
function process_response() {
Expand All @@ -354,7 +354,7 @@
//
// This is low-risk, as if the Destination validates against the `sso_sp_base`,
// it should be safe to also assume it as safe to be used on the current URL too.
$response = new SAML2Response( $saml->getSettings(), $_POST['SAMLResponse'] );

Check failure on line 357 in inc/namespace.php

View check run for this annotation

HM Linter / hmlinter

inc/namespace.php#L357

Processing form data without nonce verification.
Raw output
{
  "line": 357,
  "column": 62,
  "severity": "error",
  "message": "Processing form data without nonce verification.",
  "source": "HM.Security.NonceVerification.Missing"
}

Check failure on line 357 in inc/namespace.php

View check run for this annotation

HM Linter / hmlinter

inc/namespace.php#L357

Detected usage of a possibly undefined superglobal array index: $_POST['SAMLResponse']. Use isset() or empty() to check the index exists before using it
Raw output
{
  "line": 357,
  "column": 62,
  "severity": "error",
  "message": "Detected usage of a possibly undefined superglobal array index: $_POST['SAMLResponse']. Use isset() or empty() to check the index exists before using it",
  "source": "HM.Security.ValidatedSanitizedInput.InputNotValidated"
}

Check failure on line 357 in inc/namespace.php

View check run for this annotation

HM Linter / hmlinter

inc/namespace.php#L357

$_POST data not unslashed before sanitization. Use wp_unslash()
Raw output
{
  "line": 357,
  "column": 62,
  "severity": "error",
  "message": "$_POST data not unslashed before sanitization. Use wp_unslash()",
  "source": "HM.Security.ValidatedSanitizedInput.MissingUnslash"
}

Check failure on line 357 in inc/namespace.php

View check run for this annotation

HM Linter / hmlinter

inc/namespace.php#L357

Detected usage of a non-sanitized input variable: $_POST['SAMLResponse']
Raw output
{
  "line": 357,
  "column": 62,
  "severity": "error",
  "message": "Detected usage of a non-sanitized input variable: $_POST['SAMLResponse']",
  "source": "HM.Security.ValidatedSanitizedInput.InputNotSanitized"
}
if ( $response->getXMLDocument()->documentElement->hasAttribute( 'Destination' ) ) {
$host = parse_url( $config['sp']['assertionConsumerService']['url'], PHP_URL_HOST );
$original_host = $_SERVER['HTTP_HOST'];
Expand Down Expand Up @@ -406,7 +406,7 @@
/**
* Create a user and/or update his role based on SAML response
*
* @param \OneLogin\Saml2\Auth $saml

Check failure on line 409 in inc/namespace.php

View check run for this annotation

HM Linter / hmlinter

inc/namespace.php#L409

Missing parameter comment
Raw output
{
  "line": 409,
  "column": 4,
  "severity": "error",
  "message": "Missing parameter comment",
  "source": "Squiz.Commenting.FunctionComment.MissingParamComment"
}
*
* @return \WP_User|\WP_Error
*/
Expand All @@ -416,7 +416,7 @@
$attributes = $saml->getAttributes();
$name_id = $saml->getNameId();

// Check whether email is the unique identifier set in SAML IDP

Check failure on line 419 in inc/namespace.php

View check run for this annotation

HM Linter / hmlinter

inc/namespace.php#L419

Inline comments must end in full-stops, exclamation marks, or question marks
Raw output
{
  "line": 419,
  "column": 5,
  "severity": "error",
  "message": "Inline comments must end in full-stops, exclamation marks, or question marks",
  "source": "Squiz.Commenting.InlineComment.InvalidEndChar"
}
$is_email_auth = 'emailAddress' === substr( $saml->getNameIdFormat(), - strlen( 'emailAddress' ) );

if ( $is_email_auth ) {
Expand Down Expand Up @@ -544,10 +544,10 @@
return;
}

// Manage super admin flag

Check failure on line 547 in inc/namespace.php

View check run for this annotation

HM Linter / hmlinter

inc/namespace.php#L547

Inline comments must end in full-stops, exclamation marks, or question marks
Raw output
{
  "line": 547,
  "column": 5,
  "severity": "error",
  "message": "Inline comments must end in full-stops, exclamation marks, or question marks",
  "source": "Squiz.Commenting.InlineComment.InvalidEndChar"
}
if ( is_sso_enabled_network_wide() ) {
if ( isset( $roles['network'] ) && in_array( 'superadmin', $roles['network'], true ) ) {
$roles = array_diff( $roles['network'], [ 'superadmin' ] );
$roles['network'] = array_diff( $roles['network'], [ 'superadmin' ] );

if ( ! is_super_admin( $user->ID ) ) {
grant_super_admin( $user->ID );
Expand All @@ -558,25 +558,27 @@
}
}

// If we have specific roles for each site

Check failure on line 561 in inc/namespace.php

View check run for this annotation

HM Linter / hmlinter

inc/namespace.php#L561

Inline comments must end in full-stops, exclamation marks, or question marks
Raw output
{
  "line": 561,
  "column": 9,
  "severity": "error",
  "message": "Inline comments must end in full-stops, exclamation marks, or question marks",
  "source": "Squiz.Commenting.InlineComment.InvalidEndChar"
}
if ( isset( $roles['sites'] ) ) {
$new_site_ids = array_unique( array_filter( array_map( 'absint', array_keys( $roles['sites'] ) ) ) );
$old_site_ids = array_map( 'absint', array_keys( get_blogs_of_user( $user->ID ) ) );

// Remove the user from all other sites he shouldn't have access to

Check failure on line 566 in inc/namespace.php

View check run for this annotation

HM Linter / hmlinter

inc/namespace.php#L566

Inline comments must end in full-stops, exclamation marks, or question marks
Raw output
{
  "line": 566,
  "column": 13,
  "severity": "error",
  "message": "Inline comments must end in full-stops, exclamation marks, or question marks",
  "source": "Squiz.Commenting.InlineComment.InvalidEndChar"
}
foreach ( array_diff( $old_site_ids, $new_site_ids ) as $site_id ) {
remove_user_from_blog( $user->ID, $site_id );
}

// Add the user to the defined sites, and assign proper role(s)

Check failure on line 571 in inc/namespace.php

View check run for this annotation

HM Linter / hmlinter

inc/namespace.php#L571

Inline comments must end in full-stops, exclamation marks, or question marks
Raw output
{
  "line": 571,
  "column": 13,
  "severity": "error",
  "message": "Inline comments must end in full-stops, exclamation marks, or question marks",
  "source": "Squiz.Commenting.InlineComment.InvalidEndChar"
}
foreach ( $roles['sites'] as $site_id => $site_roles ) {
switch_to_blog( $site_id );
$user->for_site( $site_id );
$user->set_role( reset( $site_roles ) );
switch_to_blog( (int) $site_id );
$user->for_site( (int) $site_id );
add_user_to_blog( (int) $site_id, $user->ID, reset( $site_roles ) );

foreach ( array_slice( $site_roles, 1 ) as $role ) {
$user->add_role( $role );
}

restore_current_blog();
}
} elseif ( ! isset( $roles['sites'] ) && isset( $roles['network'] ) ) {
$all_site_ids = new \WP_Site_Query( [
Expand All @@ -586,13 +588,15 @@
] );

foreach ( $all_site_ids->sites as $site_id ) {
switch_to_blog( $site_id );
$user->for_site( $site_id );
$user->set_role( reset( $roles['network'] ) );
switch_to_blog( (int) $site_id );
$user->for_site( (int) $site_id );
add_user_to_blog( (int) $site_id, $user->ID, reset( $roles['network'] ) );

foreach ( array_slice( $roles['network'], 1 ) as $role ) {
$user->add_role( $role );
}

restore_current_blog();
}
}
} else {
Expand All @@ -606,7 +610,7 @@
/**
* Sign in the user, and store the auth cookie
*
* @param \WP_User $user

Check failure on line 613 in inc/namespace.php

View check run for this annotation

HM Linter / hmlinter

inc/namespace.php#L613

Missing parameter comment
Raw output
{
  "line": 613,
  "column": 4,
  "severity": "error",
  "message": "Missing parameter comment",
  "source": "Squiz.Commenting.FunctionComment.MissingParamComment"
}
*/
function signon( $user ) {
wp_set_auth_cookie( $user->ID, true, is_ssl() );
Expand All @@ -615,9 +619,9 @@
/**
* Forward IdP response to another site
*
* @param string $url

Check failure on line 622 in inc/namespace.php

View check run for this annotation

HM Linter / hmlinter

inc/namespace.php#L622

Missing parameter comment
Raw output
{
  "line": 622,
  "column": 4,
  "severity": "error",
  "message": "Missing parameter comment",
  "source": "Squiz.Commenting.FunctionComment.MissingParamComment"
}
*
* @return string $token

Check failure on line 624 in inc/namespace.php

View check run for this annotation

HM Linter / hmlinter

inc/namespace.php#L624

Function return type is not void, but function has no return statement
Raw output
{
  "line": 624,
  "column": 4,
  "severity": "error",
  "message": "Function return type is not void, but function has no return statement",
  "source": "Squiz.Commenting.FunctionComment.InvalidNoReturn"
}
*/
function cross_site_sso_redirect( $url ) {

Expand All @@ -633,7 +637,7 @@
* @return bool
*/
$allowed_hosts = apply_filters( 'wpsimplesaml_allowed_hosts', $allowed_hosts, $host, $url );
// Allow local hosts ending in .local

Check failure on line 640 in inc/namespace.php

View check run for this annotation

HM Linter / hmlinter

inc/namespace.php#L640

Inline comments must end in full-stops, exclamation marks, or question marks
Raw output
{
  "line": 640,
  "column": 5,
  "severity": "error",
  "message": "Inline comments must end in full-stops, exclamation marks, or question marks",
  "source": "Squiz.Commenting.InlineComment.InvalidEndChar"
}
if ( '.local' === substr( $host, - strlen( '.local' ) ) ) {
$allowed_hosts[] = $host;
}
Expand All @@ -642,7 +646,7 @@
wp_die( sprintf( esc_html__( '%s is not a whitelisted cross-network SSO site.', 'wp-simple-saml' ), esc_html( $host ) ) );
}

// Workaround for sub-directory installs, as we usually redirect to admin urls

Check failure on line 649 in inc/namespace.php

View check run for this annotation

HM Linter / hmlinter

inc/namespace.php#L649

Inline comments must end in full-stops, exclamation marks, or question marks
Raw output
{
  "line": 649,
  "column": 5,
  "severity": "error",
  "message": "Inline comments must end in full-stops, exclamation marks, or question marks",
  "source": "Squiz.Commenting.InlineComment.InvalidEndChar"
}
$path = wp_parse_url( $url, PHP_URL_PATH );
if ( false !== strpos( $path, '/wp-admin' ) ) {
// If we have an admin url, we know where to start from!
Expand Down Expand Up @@ -684,10 +688,10 @@
exit;
}

/**

Check failure on line 691 in inc/namespace.php

View check run for this annotation

HM Linter / hmlinter

inc/namespace.php#L691

Doc comment for parameter "$url" missing
Raw output
{
  "line": 691,
  "column": 1,
  "severity": "error",
  "message": "Doc comment for parameter \"$url\" missing",
  "source": "Squiz.Commenting.FunctionComment.MissingParamTag"
}
* Get blog ID of the passed URL, if it is on the same network
*
* @param $url

Check failure on line 694 in inc/namespace.php

View check run for this annotation

HM Linter / hmlinter

inc/namespace.php#L694

Missing parameter name
Raw output
{
  "line": 694,
  "column": 4,
  "severity": "error",
  "message": "Missing parameter name",
  "source": "Squiz.Commenting.FunctionComment.MissingParamName"
}
*
* @return int Blog ID if found, 0 if not
*/
Expand Down Expand Up @@ -717,10 +721,10 @@
* @return string
*/
function get_redirection_url() {
// Catch the redirection URL from the login page if passed

Check failure on line 724 in inc/namespace.php

View check run for this annotation

HM Linter / hmlinter

inc/namespace.php#L724

Inline comments must end in full-stops, exclamation marks, or question marks
Raw output
{
  "line": 724,
  "column": 5,
  "severity": "error",
  "message": "Inline comments must end in full-stops, exclamation marks, or question marks",
  "source": "Squiz.Commenting.InlineComment.InvalidEndChar"
}
$redirect = isset( $_REQUEST['redirect_to'] ) ? wp_unslash( $_REQUEST['redirect_to'] ) : null; // @codingStandardsIgnoreLine

// If no redirection URL exists in the URL query, see if we have one from the SAML response

Check failure on line 727 in inc/namespace.php

View check run for this annotation

HM Linter / hmlinter

inc/namespace.php#L727

Inline comments must end in full-stops, exclamation marks, or question marks
Raw output
{
  "line": 727,
  "column": 5,
  "severity": "error",
  "message": "Inline comments must end in full-stops, exclamation marks, or question marks",
  "source": "Squiz.Commenting.InlineComment.InvalidEndChar"
}
if ( empty( $redirect ) && isset( $_POST['RelayState'] ) ) { // @codingStandardsIgnoreLine
$redirect = $_POST['RelayState']; // @codingStandardsIgnoreLine
}
Expand All @@ -729,7 +733,7 @@
$redirect = urldecode( $redirect );
}

// If redirection URL is invalid or empty, fall back to admin_url()

Check failure on line 736 in inc/namespace.php

View check run for this annotation

HM Linter / hmlinter

inc/namespace.php#L736

Inline comments must end in full-stops, exclamation marks, or question marks
Raw output
{
  "line": 736,
  "column": 5,
  "severity": "error",
  "message": "Inline comments must end in full-stops, exclamation marks, or question marks",
  "source": "Squiz.Commenting.InlineComment.InvalidEndChar"
}
if ( empty( $redirect ) || ( $redirect && ! filter_var( $redirect, FILTER_VALIDATE_URL ) ) ) {
$redirect = admin_url();
}
Expand Down Expand Up @@ -762,8 +766,8 @@
/**
* Transform the roles array into a proper network roles array
*
* @param \WP_User $user

Check failure on line 769 in inc/namespace.php

View check run for this annotation

HM Linter / hmlinter

inc/namespace.php#L769

Missing parameter comment
Raw output
{
  "line": 769,
  "column": 4,
  "severity": "error",
  "message": "Missing parameter comment",
  "source": "Squiz.Commenting.FunctionComment.MissingParamComment"
}
* @param array $attributes

Check failure on line 770 in inc/namespace.php

View check run for this annotation

HM Linter / hmlinter

inc/namespace.php#L770

Missing parameter comment
Raw output
{
  "line": 770,
  "column": 4,
  "severity": "error",
  "message": "Missing parameter comment",
  "source": "Squiz.Commenting.FunctionComment.MissingParamComment"
}
*
* @return array
*/
Expand Down Expand Up @@ -806,13 +810,13 @@
$network_roles = [];

// If this is a multisite, the roles array may contain a 'network' key and a 'sites' key. Otherwise, if
// it is a flat array, use it to add the roles for all sites

Check failure on line 813 in inc/namespace.php

View check run for this annotation

HM Linter / hmlinter

inc/namespace.php#L813

Inline comments must end in full-stops, exclamation marks, or question marks
Raw output
{
  "line": 813,
  "column": 9,
  "severity": "error",
  "message": "Inline comments must end in full-stops, exclamation marks, or question marks",
  "source": "Squiz.Commenting.InlineComment.InvalidEndChar"
}
if ( is_numeric( key( $roles ) ) ) { // Not an associative array ?
if ( is_array( current( $roles ) ) ) {
// Nested array? then it is a `sites` definition, expect array of roles for each site

Check failure on line 816 in inc/namespace.php

View check run for this annotation

HM Linter / hmlinter

inc/namespace.php#L816

Inline comments must end in full-stops, exclamation marks, or question marks
Raw output
{
  "line": 816,
  "column": 17,
  "severity": "error",
  "message": "Inline comments must end in full-stops, exclamation marks, or question marks",
  "source": "Squiz.Commenting.InlineComment.InvalidEndChar"
}
$network_roles['sites'] = $roles;
} else {
// Flat array of strings ? then expect it is roles to apply on all sites

Check failure on line 819 in inc/namespace.php

View check run for this annotation

HM Linter / hmlinter

inc/namespace.php#L819

Inline comments must end in full-stops, exclamation marks, or question marks
Raw output
{
  "line": 819,
  "column": 17,
  "severity": "error",
  "message": "Inline comments must end in full-stops, exclamation marks, or question marks",
  "source": "Squiz.Commenting.InlineComment.InvalidEndChar"
}
$network_roles['network'] = $roles;
}
} elseif ( ! isset( $roles['network'] ) && ! isset( $roles['sites'] ) ) { // Associative but no 'network' or 'sites' keys ?
Expand Down
Loading