UAF + Domain Mapping

Home Forums Use Any Fonts UAF + Domain Mapping

This topic contains 2 replies, has 2 voices, and was last updated by  Dinesh 1 year, 10 months ago.

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


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

    With default URL:

    With custom URL:

    Problem is UAF only uses one URL in it’s css file:

    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:

    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]”;

    $fontsRawData = get_option(‘uaf_font_data’);



    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.




    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.


Viewing 3 posts - 1 through 3 (of 3 total)

The topic ‘UAF + Domain Mapping’ is closed to new replies.