How to use the url.endsWithPhp function in url

To help you get started, we’ve selected a few url examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github matomo-org / matomo-mobile-2 / app / models / appAccounts.js View on Github external
function appendSlashIfNecessary(accessUrl)
{
    if (!accessUrl) {
        return '';
    }

    if (!url.endsWithSlash(accessUrl) && !url.endsWithPhp(accessUrl)) {
        accessUrl = accessUrl + '/';
    } 

    return accessUrl;
}
github matomo-org / matomo-mobile-2 / app / models / appAccounts.js View on Github external
function appendIndexPhpIfNecessary(accessUrl)
{
    if (!accessUrl) {
        return '';
    }

    accessUrl = appendSlashIfNecessary(accessUrl);
    
    if (!url.endsWithPhp(accessUrl)) {
        accessUrl = accessUrl + 'index.php';
    }

    return accessUrl;
}
github matomo-org / matomo-mobile-2 / app / models / appAccounts.js View on Github external
getBasePath: function () {
                var accessUrl = this.get('accessUrl');
            
                if (!accessUrl) {
            
                    return '';
                }
                
                accessUrl = accessUrl + '';

                if (url.endsWithPhp(accessUrl)) {
                    return url.getAbsolutePath(accessUrl);
                }
            
                accessUrl = appendSlashIfNecessary(accessUrl);
            
                return accessUrl;
            },