Menu

open_basedir causing problems in mediaviewer.

Help
Nick Veit
2010-04-07
2013-05-30
  • Nick Veit

    Nick Veit - 2010-04-07

    With a blank "open_basedir" mediaview.php works fine but its not secure.

    With it set to c:\inetpub (on windows 2003 server) I get the following error:

    ERROR 2: file_exists(): open_basedir restriction in effect. File(images/facts/00_FILE_C:\I.gif) is not within the allowed path(s): (c:\inetpub)
    0 Error occurred on in function file_exists
    1 called from line 389 of file class_event.php in function Icon
    2 called from line 159 of file functions_print_facts.php in function print_fact
    3 called from line 166 of file mediaviewer.php
    Warning: file_exists(): open_basedir restriction in effect. File(images/facts/00_FILE_C:\I.gif) is not within the allowed path(s): (c:\inetpub) in C:\Inetpub\family\PhpGedView\includes\classes\class_event.php on line 389
    ERROR 2: file_exists(): open_basedir restriction in effect. File(images/facts/000_FILE_C:\I.gif) is not within the allowed path(s): (c:\inetpub)
    0 Error occurred on in function file_exists
    1 called from line 389 of file class_event.php in function Icon
    2 called from line 159 of file functions_print_facts.php in function print_fact
    3 called from line 166 of file mediaviewer.php
    Warning: file_exists(): open_basedir restriction in effect. File(images/facts/000_FILE_C:\I.gif) is not within the allowed path(s): (c:\inetpub) in C:\Inetpub\family\PhpGedView\includes\classes\class_event.php on line 389
    ERROR 2: file_exists(): open_basedir restriction in effect. File(images/facts/FILE_C:\I.gif) is not within the allowed path(s): (c:\inetpub)
    0 Error occurred on in function file_exists
    1 called from line 389 of file class_event.php in function Icon
    2 called from line 159 of file functions_print_facts.php in function print_fact
    3 called from line 166 of file mediaviewer.php
    Warning: file_exists(): open_basedir restriction in effect. File(images/facts/FILE_C:\I.gif) is not within the allowed path(s): (c:\inetpub) in C:\Inetpub\family\PhpGedView\includes\classes\class_event.php on line 389 External File

    How should I resolve this.

     
  • Greg Roach

    Greg Roach - 2010-04-07

    On the list of personal facts and details, PGV can show icons relating to each event.  A pram for a birth, a tombstone for a burial, etc.

    These icons can be date-dependent, so an EDUC record for 1800 might show an old schoolhouse while an EDUC record for 2000 might show a modern campus building.

    Since not every icon is available for every decade, the code needs to check whether the file exists first (using the file_exists() function).

    Now, here it is looking for an icon for the FILE tag.  Something has gone wrong, and "C:" has entered into the path somehow.  I've never used this feature myself (and don't have access to the code right now), so I can't investigate further, but this might give someone else a clue…..

     
  • Nick Veit

    Nick Veit - 2010-04-07

    I note there exists an empty folder called PhpGedView/images/facts/facts00_FILE_C

    I am unsure of the intention (or even the location) of this code but it would look better if ":\" were replaced with "/" maybe ?!?

     
  • Gerry Kroll

    Gerry Kroll - 2010-04-07

    Nick:
    I'm with fisharebest on this one.  I think the Fact icons are, for the most part, pretty childish and don't improve the appearanc of the Xenea theme at all.  This is the only theme where those Fact icons are partially implemented - the other themes don't have them at all.

    You can turn off the Fact icons either by deleting the "themes/xenea/images/facts" directory, or by setting a GEDCOM configuration option appropriately.

     
  • Nick Veit

    Nick Veit - 2010-04-07

    Thanks guys. Some feedback:

    1) I am using the standard theme.

    2) The SHOW FACTS ICON is a gedcom config option under DISPLAY AND LAYOUT then HIDE AND SHOW.

    3) Switching off this option prevents the file_exists check from occurring therefore the error goes away.

    4) The error also goes away for a specific media if I edit then save the media. My media are imported from Family Historian and contain no title or type attributes which are created (perhaps with others) when saved in PGV.

    Clearly, the display of this error is a bug (bad code) and should be resolved. However, the workarounds are to switch off SHOW FACTS icons and/or edit-then-save each media.

    I suspect the fact icons attempt to show an icon according to the media type and the process fails when the media type is absent.

    That's my newbie take on things and hope it helps…

     

Log in to post a comment.