HOR-838
This commit is contained in:
12
gulliver/thirdparty/phing/Phing.php
vendored
12
gulliver/thirdparty/phing/Phing.php
vendored
@@ -858,7 +858,17 @@ class Phing {
|
||||
}
|
||||
$firstPath = explode(":", implode(PATH_SEPARATOR, array_merge($new_parts, $curr_parts)));
|
||||
if (is_dir($firstPath[0])) {
|
||||
ini_set('include_path', implode(PATH_SEPARATOR, array_merge($new_parts, $curr_parts)));
|
||||
$realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] );
|
||||
$docuroot = explode( '/', $realdocuroot );
|
||||
array_pop( $docuroot );
|
||||
$pathhome = implode( '/', $docuroot ) . '/';
|
||||
array_pop( $docuroot );
|
||||
$pathTrunk = implode( '/', $docuroot ) . '/';
|
||||
require_once($pathTrunk.'gulliver/system/class.inputfilter.php');
|
||||
$filter = new InputFilter();
|
||||
$incPath = implode(PATH_SEPARATOR, array_merge($new_parts, $curr_parts));
|
||||
$incPath = $filter->validateInput($incPath, 'path');
|
||||
ini_set('include_path', $incPath);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
18
gulliver/thirdparty/phing/lib/Capsule.php
vendored
18
gulliver/thirdparty/phing/lib/Capsule.php
vendored
@@ -117,7 +117,15 @@ class Capsule {
|
||||
|
||||
// extract variables into local namespace
|
||||
extract($this->vars);
|
||||
|
||||
|
||||
$realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] );
|
||||
$docuroot = explode( '/', $realdocuroot );
|
||||
array_pop( $docuroot );
|
||||
$pathhome = implode( '/', $docuroot ) . '/';
|
||||
array_pop( $docuroot );
|
||||
$pathTrunk = implode( '/', $docuroot ) . '/';
|
||||
require_once($pathTrunk.'gulliver/system/class.inputfilter.php');
|
||||
$filter = new InputFilter();
|
||||
// prepend template path to include path,
|
||||
// so that include "path/relative/to/templates"; can be used within templates
|
||||
$__old_inc_path = ini_get('include_path');
|
||||
@@ -126,11 +134,15 @@ class Capsule {
|
||||
if(strpos($path,":")>0){
|
||||
$firstPath = explode(":", $this->templatePath . PATH_SEPARATOR . $__old_inc_path);
|
||||
if (is_dir($firstPath[0])) {
|
||||
ini_set('include_path', $this->templatePath . PATH_SEPARATOR . $__old_inc_path);
|
||||
$incPath = $this->templatePath . PATH_SEPARATOR . $__old_inc_path;
|
||||
$incPath = $filter->validateInput($incPath, 'path');
|
||||
ini_set('include_path', $incPath);
|
||||
}
|
||||
} else {
|
||||
if(is_dir($this->templatePath . PATH_SEPARATOR . $__old_inc_path)) {
|
||||
ini_set('include_path', $this->templatePath . PATH_SEPARATOR . $__old_inc_path);
|
||||
$incPath = $this->templatePath . PATH_SEPARATOR . $__old_inc_path;
|
||||
$incPath = $filter->validateInput($incPath, 'path');
|
||||
ini_set('include_path', $incPath);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -106,10 +106,20 @@ class IncludePathTask extends TaskPhing {
|
||||
$add_parts = explode(PATH_SEPARATOR, $this->classpath);
|
||||
$new_parts = array_diff($add_parts, $curr_parts);
|
||||
|
||||
$realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] );
|
||||
$docuroot = explode( '/', $realdocuroot );
|
||||
array_pop( $docuroot );
|
||||
$pathhome = implode( '/', $docuroot ) . '/';
|
||||
array_pop( $docuroot );
|
||||
$pathTrunk = implode( '/', $docuroot ) . '/';
|
||||
require_once($pathTrunk.'gulliver/system/class.inputfilter.php');
|
||||
$filter = new InputFilter();
|
||||
if ($new_parts) {
|
||||
$this->log("Prepending new include_path components: " . implode(PATH_SEPARATOR, $new_parts), PROJECT_MSG_VERBOSE);
|
||||
if(is_dir(implode(PATH_SEPARATOR, array_merge($new_parts, $curr_parts)))) {
|
||||
set_include_path(implode(PATH_SEPARATOR, array_merge($new_parts, $curr_parts)));
|
||||
$dir = implode(PATH_SEPARATOR, array_merge($new_parts, $curr_parts));
|
||||
$dir = $filter->validateInput($dir, 'path');
|
||||
if(is_dir($dir)) {
|
||||
set_include_path($dir);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user