Movatterモバイル変換


[0]ホーム

URL:


Skip to content
Search Gists
Sign in Sign up

Instantly share code, notes, and snippets.

    • Star(0)You must be signed in to star a gist
    • Fork(0)You must be signed in to fork a gist

    Select an option

    Save trycf/e9acda7c21e4393a90df69e8afadc390 to your computer and use it in GitHub Desktop.
    TryCF Gist
    <cfscript>
    getBaseUrl= (stringurlString="" )=> {
    if (len(arguments.urlString ) ) {
    varurlParts=arguments.urlString.trim().listToArray("/" );
    if(urlParts.len()>=2&&arrayFindNoCase( ["https:","http:"],urlParts[1] ) )
    returnurlParts[1]&"//"&urlParts[2]&"/";
    }
    return"";
    }
    [
    "",
    "",
    "http://google.com",
    "google.com",
    "https://localhost",
    "https://google.com/index.html",
    "https://centraladmin-sreqaohweb02.silkroad-eng.com/devutilities/sso/?company_id=3052",
    "http://sso.fbports.com/Default.aspx",
    "http://wsncohd013/bobby/ssoAuthServer/index.cfm",
    "https://azusapacificuniversity-lsauth.silkroad.com/Default.aspx?referer=https://apu-staging-openhire.silkroad.com/index.cfm?fuseaction=authentication.login",
    "https://autokiniton-test-redcarpet.silkroad.com/Authentication?referer=https://towerinternational-staging-openhire.silkroad.com/index.cfm%3Ffuseaction=authentication.login",
    "https://MSGCU-Staging-redcarpet.silkroad.com/Authentication?referer=https://MSGCU-Staging-openhire.silkroad.com/index.cfm?fuseaction=authentication.login"
    ].each( (_url )=>dump(getBaseUrl(_url ) ) )
    </cfscript>
    Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

    [8]ページ先頭

    ©2009-2025 Movatter.jp