• Resolved artemis.radial

    (@artemisradial)


    On some installations upload_path has a tailing ‘/’, so S3Plugin::$mediaUrl gets ‘http://www.dfgdg.com//’ and the plugin can not check for images on the post’s content.

    So I changed my s3.php from

    $this->mediaUrl = get_option ( ‘siteurl’ ) . ‘/’ . get_option ( ‘upload_path’, ‘wp-content/uploads’ ) . ‘/’;
    $this->mediaPath = ABSPATH . get_option ( ‘upload_path’, ‘wp-content/uploads’ ) . DIRECTORY_SEPARATOR;

    to

    $this->mediaUrl = get_option ( ‘siteurl’ ) . ‘/’ . get_option ( ‘upload_path’, ‘wp-content/uploads’ );
    $this->mediaPath = ABSPATH . get_option ( ‘upload_path’, ‘wp-content/uploads’ );
    if (substr($this->mediaUrl, -1) !== DIRECTORY_SEPARATOR)
    $this->mediaUrl .= $this->mediaUrl;
    if (substr($this->mediaPath, -1) !== DIRECTORY_SEPARATOR)
    $this->mediaPath .= $this->mediaUrl;

    http://wordpress.org/extend/plugins/wp-s3/

Viewing 1 replies (of 1 total)
  • Thread Starter artemis.radial

    (@artemisradial)

    a mistake in the code above
    the final code is following

    $this->mediaUrl = get_option ( 'siteurl' ) . '/' . get_option ( 'upload_path', 'wp-content/uploads' );
    $this->mediaPath = ABSPATH . get_option ( 'upload_path', 'wp-content/uploads' );
    if (substr($this->mediaUrl, -1) !== DIRECTORY_SEPARATOR)
        $this->mediaUrl .= DIRECTORY_SEPARATOR;
    if (substr($this->mediaPath, -1) !== DIRECTORY_SEPARATOR)
        $this->mediaPath .= DIRECTORY_SEPARATOR;
Viewing 1 replies (of 1 total)
  • The topic ‘[Plugin: WordPress Amazon S3 Plugin] unable to work’ is closed to new replies.