#2 open
MarmaladeToday

Plugin doesn't deal with full URL paths

Reported by MarmaladeToday | February 28th, 2010 @ 07:58 PM

Hi again,

re. the previous ticket, I rolled back to your v.1.0 which isn't affected by the get_instance() issue so I could get things working.

However, it and v.2. are affected by only dealing with paths that don't contain the domain in the URL.

I added a little code to get around this for my purposes (an old Mark Huot gen. full domain path, e.g. http://www.site.com/path.file.ending)

Where you check and fix the file path in __construct(), if you add this:

else if (stristr($this->file, $_SERVER['SERVER_NAME']))
{
    $parts = parse_url($this->file);
    $this->file =  $_SERVER['DOCUMENT_ROOT'] . $parts['path'];
}

I think you should be okay. I am at least. Let me know if you can think of any potential issues I'm being blind to.

You may need to repeat that in v.2. in get_file_data() as your file checking code is repeated there. Not so in v.1.

Cheers,

Aidann

Comments and changes to this ticket

  • Stephen

    Stephen August 1st, 2010 @ 02:38 AM

    • Tag set to custom field

    I'm trying to get data using a custom field. I believe I'm having a hard time because it doesn't support full urls.

    Could you please be more specific about where this code needs to go.

    thanks

  • MarmaladeToday

    MarmaladeToday August 1st, 2010 @ 01:19 PM

    Sure Stephen.

    I added that code to version 1.0.0 for EE 1.6x at line 110, in the public function __construct() so that the file checking conditional from lines 106 onwards looks like this:

    if (stristr($this->file, $_SERVER['DOCUMENT_ROOT']))
    {

    $this->file =  $this->file;
    

    } else if (stristr($this->file, $_SERVER['SERVER_NAME']))
    {

    $parts = parse_url($this->file);
    $this->file =  $_SERVER['DOCUMENT_ROOT'] . $parts['path'];
    

    } else
    {

    $this->file = $_SERVER['DOCUMENT_ROOT'] . $this->file;
    

    }

    Hope that helps,

    Aidann

  • MarmaladeToday

    MarmaladeToday August 1st, 2010 @ 01:21 PM

    Sorry, should have checked the formatting of that before posting. Let's try that again:

    if (stristr($this->file, $_SERVER['DOCUMENT_ROOT']))
    {
        $this->file =  $this->file;
    }
    else if (stristr($this->file, $_SERVER['SERVER_NAME']))
    {
        $parts = parse_url($this->file);
        $this->file =  $_SERVER['DOCUMENT_ROOT'] . $parts['path'];
    }
    else
    {
        $this->file = $_SERVER['DOCUMENT_ROOT'] . $this->file;          
    }
    
  • Stephen

    Stephen August 3rd, 2010 @ 10:24 PM

    • Tag changed from custom field to custom field, plugins page, white screen

    This helped a lot.

    This might be another ticket.
    I had to reinstall EE due to other issues. After I uploaded the file oracle plugin, I can't access my plugins page. I just get blank white screen. If I remove file oracle, my plugins page works fine.

  • Stephen

    Stephen August 3rd, 2010 @ 11:29 PM

    I'm also on EE 2.1.0

  • MarmaladeToday

    MarmaladeToday August 4th, 2010 @ 12:13 PM

    Yes, this sounds like a different ticket.

    Which version of File Oracle are you using?

    v1 is for EE 1.x
    v2 is for EE 2.x

  • George Ornbo

    George Ornbo August 4th, 2010 @ 05:48 PM

    • State changed from “new” to “open”

    Aidaan

    Thanks for that. You are right - the plugin doesn't currently support full paths.

    I'll roll your fix into the next release (no commitments on dates I'm afraid!)

    Stephen - it sounds like your issue is a PHP error. In order to find out what this if the error is in your control panel you can edit /system/index.php and set debug = 1 to display PHP errors.

  • MarmaladeToday

    MarmaladeToday September 17th, 2010 @ 02:17 PM

    Hi George,

    Just thought I'd report that this fix is also needed (and appears to work) in both __construct() and get_file_data() too for the EE2 version.

    Aidann

  • Billyssimo

    Billyssimo April 21st, 2024 @ 05:10 PM

    I used http://markets.businessinsider.com/news/stocks/stormotion-decodes-t... to create apps and was impressed with its functionality and ease of use. Using this application, I was able to easily create my own application without the need for in-depth programming knowledge. The application interface is intuitive.

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

Provides comprehensive information on a file

Shared Ticket Bins

People watching this ticket

Pages