Project

General

Profile

Revision 245 branches/extplorer2

View differences:

libraries/Archive/file.php
29 29
	 * @return string The file extension
30 30
	 * @since 1.5
31 31
	 */
32
	function getExt($file) {
32
	static function getExt($file) {
33 33
		$dot = strrpos($file, '.') + 1;
34 34
		return substr($file, $dot);
35 35
	}
......
41 41
	 * @return string The file name without the extension
42 42
	 * @since 1.5
43 43
	 */
44
	function stripExt($file) {
44
	static function stripExt($file) {
45 45
		return preg_replace('#\.[^.]*$#', '', $file);
46 46
	}
47 47

  
......
52 52
	 * @return string The sanitised string
53 53
	 * @since 1.5
54 54
	 */
55
	function makeSafe($file) {
55
	static function makeSafe($file) {
56 56
		$regex = array('#(\.){2,}#', '#[^A-Za-z0-9\.\_\- ]#', '#^\.#');
57 57
		return preg_replace($regex, '', $file);
58 58
	}
......
69 69
	 * @return mixed Returns file contents or boolean False if failed
70 70
	 * @since 1.5
71 71
	 */
72
	function read($filename, $incpath = false, $amount = 0, $chunksize = 8192, $offset = 0)
72
	static function read($filename, $incpath = false, $amount = 0, $chunksize = 8192, $offset = 0)
73 73
	{
74 74
		// Initialize variables
75 75
		$data = null;
......
110 110
	 * @return boolean True if path is a file
111 111
	 * @since 1.5
112 112
	 */
113
	function exists($file)
113
	static function exists($file)
114 114
	{
115 115
		return is_file(extPath::clean($file));
116 116
	}
......
122 122
	 * @return string filename
123 123
	 * @since 1.5
124 124
	 */
125
	function getName($file) {
125
	static function getName($file) {
126 126
		$slash = strrpos($file, DS);
127 127
		if ($slash !== false) {
128 128
			return substr($file, $slash + 1);
libraries/Archive/archive.php
27 27
	 * @param	string	Directory to unpack into
28 28
	 * @return	boolean	True for success
29 29
	 */
30
	function extract( $archivename, $extractdir ) {
30
	static function extract( $archivename, $extractdir ) {
31 31
		require_once( dirname(__FILE__). '/file.php' ) ;
32 32
		require_once( dirname(__FILE__). '/folder.php' ) ;
33 33

  
install.extplorer.php
32 32
		$extract_dir = $mypath.'/';
33 33
		
34 34
		$result = extArchive::extract( $archive_name, $extract_dir );
35
		if( !PEAR::isError( $result )) {
35
		if( !@PEAR::isError( $result )) {
36 36
			unlink( $archive_name );
37 37
		} else {
38 38
			echo '<pre style="color:white; font-weight:bold; background-color:red;">Error!
......
64 64
			public function install( $adapter){
65 65
				$adminpath = JPATH_SITE.'/administrator/components/com_extplorer';
66 66
				com_install($adminpath);
67
				if(JVersion::isCompatible('3.0')) rename($adminpath.'/extplorer.j30.php', $adminpath.'/extplorer.php');
67
				$version = new JVersion;
68
				if($version->isCompatible('3.0')) rename($adminpath.'/extplorer.j30.php', $adminpath.'/extplorer.php');
68 69
				return true;
69 70
			}
70 71
			/**
include/rename.php
145 145
					action: 'rename', 
146 146
					dir: '<?php echo stripslashes($dir) ?>', 
147 147
					item: '<?php echo stripslashes($item) ?>', 
148
					confirm: 'true'
148
					confirm: 'true',
149
					token: "<?php echo ext_getToken() ?>"
149 150
				}
150 151
			});
151 152
		}
include/mkitem.php
150 150
					params: {option: "com_extplorer", 
151 151
							action: "mkitem", 
152 152
							dir: datastore.directory, 
153
							confirm: "true"}
153
							confirm: "true",
154
							token: "<?php echo ext_getToken() ?>"
155
					}
154 156
				})
155 157
			}
156 158
		},{
include/bookmarks.php
75 75
function ext_modify_bookmark( $task, $dir ) {
76 76
	global $my, $user, $mainframe;
77 77
	$alias = substr( extGetParam($_REQUEST,'alias'), 0, 150 );
78
	// CSRF Security Check
79
	if( !ext_checkToken($GLOBALS['__POST']["token"]) ) {
80
		ext_Result::sendResult('tokencheck', false, 'Request failed: Security Token not valid.');
81
	}
78 82
	$bookmarks = read_bookmarks();
79 83
		$bookmarkfile = _EXT_PATH.'/config/bookmarks_'.$GLOBALS['file_mode'].'_';
80 84
	if( empty( $my->id )) {
......
176 180
						.'requestType: \'xmlhttprequest\', '
177 181
						.'alias: text, '
178 182
						.'dir: \''.$dir.'\', '
183
						.'token: \''.ext_getToken().'\', '
179 184
						.'option: \'com_extplorer\' '
180 185
					.'} '
181 186
				.'}); '
......
193 198
						.'action:\'modify_bookmark\', '
194 199
						.'task: \'remove\', '
195 200
						.'dir: \''.$dir.'\', '
201
						.'token: \''.ext_getToken().'\', '
196 202
						.'option: \'com_extplorer\' '
197 203
					.'} '
198 204
				.'}); '
build_component.bat
10 10
rem Please update the program path here accordingly
11 11

  
12 12

  
13
set PATH="c:\Projekte\extplorer\svn-extplorer2\"
13
set PATH="e:\Projekte\extplorer\svn-extplorer2\"
14 14

  
15 15
cd %PATH%
16 16

  

Also available in: Unified diff