Uploaded image for project: 'In-Portal CMS'
  1. In-Portal CMS
  2. INP-1328

Unify BaseURL method logic for ssl and non-ssl urls

    XMLWordPrintable

    Details

    • Change Log Group:
      Added
    • Change Log Message:
      Allow specifying domain to be used in "kApplication::BaseURL" method.
    • Story Points:
      1
    • Copy Issue Key:
    • Patch Instructions:

      Patches must be submitted through Phabricator.

    • BC Break Details:
      Hide

      Method signature changed:

      • kApplication::BaseURL (the "$prefix" parameter renamed into "$domain" parameter, the "$ssl" parameter renamed into "$ssl_redirect" parameter, optional "$add_port" parameter removed)
      • FileHelper::pathToUrl (the "$url" parameter renamed into "$path", added optional "$domain" parameter)

      Columns changed:

      • the "SSLUrl" column of "SiteDomains" table changed into "SSLDomainName" column
      • the "SSLUrlUsesRegExp" column of "SiteDomains" table changed into "SSLDomainNameUsesRegExp" column

      System settings changed:

      • the "SSL_URL" system setting changed into "SSLDomain"
      • the "AdminSSL_URL" system setting changed into "AdminSSLDomain"

      Solution

      1. for "kApplication::BaseURL" when "$domain" parameter isn't empty, but doesn't contain dot (domain usually contain dot):
        • treat it as removed "$prefix" parameter
        • set "$domain" to empty string (default domain)
        • trigger a deprecation notice (the "kUtil::deprecatedParameter" method call)
      Show
      Method signature changed: kApplication::BaseURL (the "$prefix" parameter renamed into "$domain" parameter, the "$ssl" parameter renamed into "$ssl_redirect" parameter, optional "$add_port" parameter removed) FileHelper::pathToUrl (the "$url" parameter renamed into "$path", added optional "$domain" parameter) Columns changed: the "SSLUrl" column of "SiteDomains" table changed into "SSLDomainName" column the "SSLUrlUsesRegExp" column of "SiteDomains" table changed into "SSLDomainNameUsesRegExp" column System settings changed: the "SSL_URL" system setting changed into "SSLDomain" the "AdminSSL_URL" system setting changed into "AdminSSLDomain" Solution for "kApplication::BaseURL" when "$domain" parameter isn't empty, but doesn't contain dot (domain usually contain dot): treat it as removed "$prefix" parameter set "$domain" to empty string (default domain) trigger a deprecation notice (the "kUtil::deprecatedParameter" method call)

      Description

      Analysis (BaseURL method usages):

      • total: 51
      • where at least 1st ($prefix) parameter was given: 13
      • where 2nd($ssl) and/or 3rd ($add_port) parameter was given: 1

      Plan:

      1. migrate domain url part (only, when entered) from "SSL_URL" system setting to new "SSLDomain" system setting - 0.5h
      2. migrate domain url part (only, when entered) from "AdminSSL_URL" system setting to new "AdminSSLDomain" system setting - 0.5h
      3. perform similar migration for all site domains - 1h
      4. places where BaseURL method was used without any parameters given are unaffected
      5. move out $prefix parameter value after BaseURL method call (keep in mind trailing /) - 1h
      6. move out SSL url detection code from BaseURL into kUrlManager - 1h
      7. replace all BaseURL method parameters with optional $domain parameter, that would replace the domain, that this method wants to use (e.g. from site domain)
      8. pass in generated ssl domain (when ssl is about to be used) as $domain parameter in kUrlManager class - 0.5h

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                alex Alex
                Reporter:
                alex Alex
                Developer:
                Alex
                Reviewer:
                Dmitry Andrejev [Intechnic]
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: