UAF + Domain Mapping

Home Forums Use Any Fonts UAF + Domain Mapping

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #4050
    Jake
    Guest

    I’m using domain mapping with my multisite install. This allows me to have a URL work both ways like so:

    With default URL:
    http://symphonyinthestars.etsythemeshop.com/whats-new-with-us/

    With custom URL:
    http://symphonyinthestars.com/whats-new-with-us/

    Problem is UAF only uses one URL in it’s css file:
    http://sht.tl/r5ye8P

    So, it doesn’t work because a cross-domain request is made to the font-file, which fails.

    My temporary solution is to fix it so that the URL generated by UAF does not contain the domain name, so it will load relative to root, for instance:
    /wp-content/uploads/sites/21893/useanyfont/150307083333Deibi.eot

    Downsides to this approach? Perhaps make it official?

    My fix to plugin_interface.php:
    function uaf_write_css(){
    $uaf_upload = wp_upload_dir();
    $uaf_upload_dir = $uaf_upload[‘basedir’];
    $uaf_upload_dir = $uaf_upload_dir . ‘/useanyfont/’;
    $uaf_upload_url = $uaf_upload[‘baseurl’];
    $uaf_upload_url = $uaf_upload_url . ‘/useanyfont/’;

    // $uaf_upload_url = preg_replace(‘#^https?:#’, ”, $uaf_upload_url);

    $parts = parse_url($uaf_upload_url);
    $uaf_upload_url = “$parts[path]$parts[query]$parts[fragment]”;

    ob_start();
    $fontsRawData = get_option(‘uaf_font_data’);

    #4054
    Dinesh
    Keymaster

    Hi Jake,

    Thank you so much for the proper explanation and the solution.

    I will try with this one, test it and if everything goes fine, will use it in next release.

    Thanks

    #4304
    Dinesh
    Keymaster

    Hi Jake,

    I have added an option in additional settings called Use relative path for font (Needed when you have domain mapping). . So if user needs it, they can tick this option and enable relative path.

    We are going to release this update next day. You can update it from wordpress dashboard.

    Thanks

Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘UAF + Domain Mapping’ is closed to new replies.