• Resolved SharmPRO

    (@sharmpro)


    On my live server i couldn’t see the thumbnails of the pictures…
    the difference was due to ‘realpath’ different on local and remote server.
    Here below a quick patch to solve the problem.

    file: media-relocator.php

    function mfma_relocator_path2url($pathname) {
    $pathname = realpath($pathname);
    $path0 = str_replace(“\\”, “/”, $pathname);
    $path = str_replace(“//”, “/”, $path0);
    if (stripos($path0, “//”) === 0)
    $path = “/” . $path;
    $urlroot = mfma_relocator_get_urlroot();

    $docroot = $_SERVER[‘DOCUMENT_ROOT’];
    $docroot = realpath($docroot);
    if (stripos($path, $docroot) != 0) {
    return “”;
    }
    $ret1 = substr($path, strlen($docroot));

    return mfma_rl_adjpath($urlroot . “/” . $ret1);
    }

    https://wordpress.org/plugins/media-file-manager-advanced/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Zefta

    (@zefta)

    Hello,

    Sorry for that, I’m currently working on refactoring the code and use only absolute path.

    Thanks for your coding. If you want i cant send you an alpha version to test it on your server and check for mistakes.

    Thread Starter SharmPRO

    (@sharmpro)

    Hi,
    I can test your Alpha anytime with pleasure.
    A nice feature would be a ‘list’ beside ‘thumbnail’ view.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Realpath neeed to avoid bug on 1and1 shared server’ is closed to new replies.