protected function validateOrigin($origin, $allowedOrigins)
    {
        if (empty($allowedOrigins) || empty($origin)) {
            return false;
        }
        foreach ($allowedOrigins as $allowedOrigin) {
            if ($allowedOrigin === '*') {
                return true;
            }
            if (strcasecmp($allowedOrigin, $origin) === 0) {
                return true;
            }
        }
        return false;
    }
protected function validateOrigin($origin, $allowedOrigins)
    {
        if (empty($allowedOrigins) || empty($origin)) {
            return false;
        }
        foreach ($allowedOrigins as $allowedOrigin) {
            if ($allowedOrigin === '*') {
                return true;
            }
            if (strcasecmp($allowedOrigin, $origin) === 0) {
                return true;
            }
        }
        return false;
    }
protected function validateOrigin ( $ origin , $ allowedOrigins ) { if ( empty ( $ allowedOrigins ) || empty ( $ origin ) ) { return false ; } foreach ( $ allowedOrigins as $ allowedOrigin ) { if ( $ allowedOrigin === '*' ) { return true ; } if ( strcasecmp ( $ allowedOrigin , $ origin ) === 0 ) { return true ; } } return false ; }
Validate an origin matches a set of allowed origins

@param string $origin Origin string
@param array $allowedOrigins List of allowed origins
@return bool
Validate an origin matches a set of allowed origins