#2 open
MarmaladeToday

Plugin doesn't deal with full URL paths

Reported by MarmaladeToday | 2010-02-28 19:58:57 UTC

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 2010-08-01 02:38:35 UTC

    • 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 2010-08-01 13:19:04 UTC

    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 2010-08-01 13:21:17 UTC

    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 2010-08-03 22:24:13 UTC

    • 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 2010-08-03 23:29:21 UTC

    I'm also on EE 2.1.0

  • MarmaladeToday

    MarmaladeToday 2010-08-04 12:13:34 UTC

    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 2010-08-04 17:48:33 UTC

    • 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 2010-09-17 14:17:44 UTC

    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

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