Project

General

Profile

Revision 248

View differences:

branches/extplorer2/include/archive.php
38 38
 */
39 39
class ext_Archive extends ext_Action {
40 40

  
41
	function execAction( $dir ) {
41
	function execAction( $dir, $item="" ) {
42 42

  
43 43
		if(($GLOBALS["permissions"]&01)!=01) {
44 44
			ext_Result::sendResult('archive', false, $GLOBALS["error_msg"]["accessfunc"]);
branches/extplorer2/include/upload.php
4 4
/**
5 5
 * @version $Id$
6 6
 * @package eXtplorer
7
 * @copyright soeren 2007-2015
7
 * @copyright soeren 2007-2016
8 8
 * @author The eXtplorer project (http://extplorer.net)
9 9
 * @author The	The QuiX project (http://quixplorer.sourceforge.net)
10 10
 * @license
......
36 36
 */
37 37
class ext_Upload extends ext_Action {
38 38

  
39
	function execAction($dir) {
39
	function execAction($dir, $item="") {
40 40

  
41 41
		if(($GLOBALS["permissions"]&01)!=01) {
42 42
			ext_Result::sendResult('upload', false, ext_Lang::err('accessfunc'));
......
170 170
				"action": "upload", 
171 171
				"dir": datastore.directory, 
172 172
				"requestType": "xmlhttprequest",
173
				"confirm": "true"
173
				"confirm": "true",
174
				"token": "<?php echo ext_getToken() ?>"
174 175
			},
175 176
			
176 177
<?php
branches/extplorer2/include/transfer.php
37 37
class ext_Transfer extends ext_Action {
38 38
	var $_downloadMethods;
39 39

  
40
	function execAction( $dir ) {
40
	function execAction( $dir, $item="" ) {
41 41

  
42 42
		if(($GLOBALS["permissions"]&01)!=01) {
43 43
			ext_Result::sendResult('upload', false, $GLOBALS["error_msg"]["accessfunc"]);
......
360 360
	}
361 361
}
362 362
function isPhpFunctionSupported($functionName) {
363
	if (in_array($functionName, split(',\s*', ini_get('disable_functions'))) || !function_exists($functionName)) {
363
	if (in_array($functionName, explode(',\s*', ini_get('disable_functions'))) || !function_exists($functionName)) {
364 364
		return false;
365 365
	} else {
366 366
		return true;
branches/extplorer2/include/mkitem.php
37 37
 */
38 38
class ext_Mkitem extends ext_Action {
39 39

  
40
	function execAction($dir) {		// make new directory or file
40
	function execAction($dir, $item="") {		// make new directory or file
41 41
		if(($GLOBALS["permissions"]&01)!=01) ext_Result::sendResult( 'mkitem', false, $GLOBALS["error_msg"]["accessfunc"]);
42 42

  
43 43
		if( extGetParam($_POST,'confirm') == 'true') {
branches/extplorer2/include/delete.php
4 4
/**
5 5
 * @version $Id$
6 6
 * @package eXtplorer
7
 * @copyright soeren 2007-2015
7
 * @copyright soeren 2007-2016
8 8
 * @author The eXtplorer project (http://extplorer.net)
9 9
 * @author The	The QuiX project (http://quixplorer.sourceforge.net)
10 10
 * 
......
40 40
 */
41 41
class ext_Delete extends ext_Action {
42 42

  
43
	function execAction($dir) {
43
	function execAction($dir, $item="") {
44 44
		// delete files/dirs
45 45
		if(($GLOBALS["permissions"]&01)!=01) 
46 46
		ext_Result::sendResult('delete', false, $GLOBALS["error_msg"]["accessfunc"]);
branches/extplorer2/include/functions.php
324 324
	if($item == "." || $item == ".." ||
325 325
		(substr($item,0,1)=="." && $GLOBALS["show_hidden"]==false)) return false;
326 326

  
327
	if($GLOBALS["no_access"]!="" && @eregi($GLOBALS["no_access"],$item)) return false;
327
	if($GLOBALS["no_access"]!="" && @preg_match($GLOBALS["no_access"],$item)) return false;
328 328

  
329 329
	if($GLOBALS["show_hidden"]==false) {
330 330
		$dirs=explode("/",$dir);
......
547 547
}
548 548

  
549 549
function calc_php_setting_bytes( $value ) {
550
	if(@eregi("G$",$value)) {
550
	switch(strtoupper(substr($value,-1))) {
551
		case 'G':
551 552
		$value = substr($value,0,-1);
552 553
		$value = round($value*1073741824);
553
	} elseif(@eregi("M$",$value)) {
554
		break;
555
	case 'M':
554 556
		$value = substr($value,0,-1);
555 557
		$value = round($value*1048576);
556
	} elseif(@eregi("K$",$value)) {
558
		break;
559
	case 'K':
557 560
		$value = substr($value,0,-1);
558 561
		$value = round($value*1024);
562
		break;
559 563
	}
560 564

  
561 565
	return $value;
branches/extplorer2/include/view.php
4 4
/**
5 5
 * @version $Id$
6 6
 * @package eXtplorer
7
 * @copyright soeren 2007-2011
7
 * @copyright soeren 2007-2016
8 8
 * @author The eXtplorer project (http://extplorer.net)
9 9
 * 
10 10
 * @license
......
40 40
	function execAction($dir, $item) {		// show file contents
41 41
		global $action;
42 42
		$item = basename($item);
43
		if( @eregi($GLOBALS["images_ext"], $item)) {
43
		if(in_array(".".strtolower(pathinfo($item,PATHINFO_EXTENSION )), $GLOBALS["images_ext"])) {
44 44
			$html =  '<img src="'.ext_make_link( 'get_image', $dir, rawurlencode($item)).'" alt="'.$GLOBALS["messages"]["actview"].": ".$item.'" /><br /><br />';
45 45
		}
46 46

  
47
		elseif( @eregi($GLOBALS["editable_ext"], $item)) {
47
		elseif(in_array(".".strtolower(pathinfo($item,PATHINFO_EXTENSION )), $GLOBALS["editable_ext"])) {
48 48

  
49 49
			$geshiFile = _EXT_PATH . '/libraries/geshi/geshi.php';
50 50

  
......
123 123
}
124 124
		<?php
125 125
	}
126
	function sendImage( $dir, $item ) {
126
	static function sendImage( $dir, $item ) {
127 127
		$item = basename($item);
128 128
		$abs_item = get_abs_item( $dir, $item );
129 129
		if( $GLOBALS['ext_File']->file_exists( $abs_item )) {
130
  			if(!@eregi($GLOBALS["images_ext"], $item)) return;
130
			if(!in_array(".".strtolower(pathinfo($item,PATHINFO_EXTENSION )), $GLOBALS["images_ext"])) {
131
				return;
132
			}
131 133
  			while( @ob_end_clean() );
132 134
  
133 135
  			$pathinfo = pathinfo( $item );
branches/extplorer2/libraries/Archive/archive.php
65 65
		return $result;
66 66
	}
67 67
	
68
	function &getAdapter( $type ) {
68
	static function &getAdapter( $type ) {
69 69
		static $adapters ;
70 70
		
71 71
		if( ! isset( $adapters ) ) {
......
100 100
	 * @param	boolean	Automatically append the extension for the archive
101 101
	 * @param	boolean	Remove for source files
102 102
	 */
103
	function create( $archive, $files, $compress = 'tar', $addPath = '', $removePath = '', $autoExt = false ) {
103
	static function create( $archive, $files, $compress = 'tar', $addPath = '', $removePath = '', $autoExt = false ) {
104 104
		$compress = strtolower( $compress );
105 105
		if( $compress == 'tgz' || $compress == 'tbz' || $compress == 'tar') {
106 106
			

Also available in: Unified diff