Page MenuHomePhabricator

Revision 72797 breaks 'vector' skin
Closed, ResolvedPublic

Description

Author: jorisaerts+mwbz

Description:
Since rev 72797 I get the following error (results in vector skin only showing plain text in Chrome)

<b>Warning</b>: file_exists() [<a href='function.file-exists'>function.file-exists</a>]: open_basedir restriction in effect. File(/wiki/skins/common/images/add.png) is not within the allowed path(s): (/var/www/vhosts/xxxxxxxx.nl/httpdocs:/tmp) in <b>/var/www/vhosts/xxxxxxxx.nl/httpdocs/wiki/includes/libs/CSSMin.php</b> on line <b>69</b><br />

Which is:
$file = ( isset( $path ) ? rtrim( $path, '/' ) . '/' : '' ) . "{$match['file'][0]}";

replacing '' with './' seems to resolve it but I dont know if this is a proper workaround.


Version: 1.17.x
Severity: normal

Details

Reference
bz25182

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 11:20 PM
bzimport set Reference to bz25182.

r72797

(to get the automagic link)

Meh. Does replacing file_exists() with is_file() fix this? Alternatively, could you try changing this:

if ( file_exists( $file ) ) {

some code here

}

with

wfSuppressWarnings();
if ( file_exists( $file ) ) {

some code here

}
wfRestoreWarnings();

and see if that helps?

jorisaerts+mwbz wrote:

thnx for the tip Guillaume.

is_file didn't change a thing. SuppressWarnings does.

Attempted to fix this in 73115, could you test that?

jorisaerts+mwbz wrote:

r73115 solved my problem, but again not really sure if this serves the purpose of the function. Thnx