Merge branch 'master' of bitbucket.org:colosa/processmaker

This commit is contained in:
Victor Saisa Lopez
2015-05-19 11:32:45 -04:00
4 changed files with 44 additions and 9 deletions

View File

@@ -463,10 +463,17 @@ class G
* @return void
*/
public static function LoadSystem ($strClass)
{ require_once (PATH_GULLIVER . 'class.inputfilter.php');
$filter = new InputFilter();
{
$path = PATH_GULLIVER . 'class.' . $strClass . '.php';
$path = $filter->validateInput($path, 'path');
if(file_exists(PATH_GULLIVER . 'class.inputfilter.php')) {
require_once (PATH_GULLIVER . 'class.inputfilter.php');
$filter = new InputFilter();
$path = $filter->validateInput($path, 'path');
} else {
if(!file_exists($path)) {
$path = '';
}
}
require_once ($path);
}
@@ -2656,6 +2663,7 @@ class G
$path = $filter->validateInput($path, "path");
move_uploaded_file( $file, $path . "/" . $nameToSave );
$nameToSave = $filter->validateInput($nameToSave, "path");
@chmod( $path . "/" . $nameToSave, $permission );
umask( $oldumask );

View File

@@ -634,15 +634,29 @@
$dir = dirname($path)."/";
$base = basename($path);
if (!class_exists('G')) {
$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.g.php');
}
G::LoadSystem('inputfilter');
$filter = new InputFilter();
foreach($options["props"] as $key => $prop) {
if ($prop["ns"] == "DAV:") {
$options["props"][$key]['status'] = "403 Forbidden";
} else {
if (isset($prop["val"])) {
$query = "REPLACE INTO properties SET path = '$options[path]', name = '$prop[name]', ns= '$prop[ns]', value = '$prop[val]'";
$query = "REPLACE INTO properties SET path = '%s', name = '%s', ns= '%s', value = '%s'";
$query = $filter->preventSqlInjection($query, Array($options['path'],$prop['name'],$prop['ns'],$prop['val']));
error_log($query);
} else {
$query = "DELETE FROM properties WHERE path = '$options[path]' AND name = '$prop[name]' AND ns = '$prop[ns]'";
$query = "DELETE FROM properties WHERE path = '%s' AND name = '%s' AND ns = '%s'";
$query = $filter->preventSqlInjection($query, Array($options['path'],$prop['name'],$prop['ns']));
}
mysql_query($query);
}

View File

@@ -902,16 +902,21 @@ class ProcessMakerWebDav extends HTTP_WebDAV_Server
$dir = dirname($path) . "/";
$base = basename($path);
G::LoadSystem('inputfilter');
$filter = new InputFilter();
foreach ($options["props"] as $key => $prop) {
if ($prop["ns"] == "DAV:") {
$options["props"][$key]['status'] = "403 Forbidden";
} else {
if (isset($prop["val"])) {
$query = "REPLACE INTO properties SET path = '$options[path]', name = '$prop[name]', ns= '$prop[ns]', value = '$prop[val]'";
$query = "REPLACE INTO properties SET path = '%s', name = '%s', ns= '%s', value = '%s'";
$query = $filter->preventSqlInjection($query, Array($options['path'],$prop['name'],$prop['ns'],$prop['val']));
error_log($query);
} else {
$query = "DELETE FROM properties WHERE path = '$options[path]' AND name = '$prop[name]' AND ns = '$prop[ns]'";
$query = "DELETE FROM properties WHERE path = '%s' AND name = '%s' AND ns = '%s'";
$query = $filter->preventSqlInjection($query, Array($options['path'],$prop['name'],$prop['ns']));
}
mysql_query($query);
}

View File

@@ -315,6 +315,10 @@ class Installer extends Controller
$info->success = false;
}
}
G::LoadSystem('inputfilter');
$filter = new InputFilter();
$pathShared = $filter->validateInput($_REQUEST['pathShared'], 'path');
if ($info->pathShared->result) {
$aux = pathinfo( $_REQUEST['pathLogFile'] );
@@ -322,7 +326,7 @@ class Installer extends Controller
if (is_dir( $aux['dirname'] )) {
if (! file_exists( $_REQUEST['pathLogFile'] )) {
@file_put_contents( $_REQUEST['pathLogFile'], '' );
@chmod($_REQUEST['pathShared'], 0770);
@chmod($pathShared , 0770);
}
}
}
@@ -388,7 +392,11 @@ class Installer extends Controller
return $false;
}
}
G::LoadSystem('inputfilter');
$filter = new InputFilter();
$logFile = $filter->validateInput($logFile, 'path');
$fpt = fopen( $logFile, 'a' );
fwrite( $fpt, sprintf( "%s %s\n", date( 'Y:m:d H:i:s' ), trim( $text ) ) );
fclose( $fpt );