[geeklog-cvs] Geeklog-1.x/public_html/fckeditor/editor/filemanager/connectors/lasso config.lasso, 1.1, 1.2 connector.lasso, 1.1, 1.2 upload.lasso, 1.1, 1.2

Blaine Lang blaine at qs1489.pair.com
Sun May 4 20:35:29 EDT 2008


Update of /cvsroot/geeklog/Geeklog-1.x/public_html/fckeditor/editor/filemanager/connectors/lasso
In directory qs1489.pair.com:/tmp/cvs-serv85146/editor/filemanager/connectors/lasso

Modified Files:
	config.lasso connector.lasso upload.lasso 
Log Message:
Upgraded the FCKeditor to version 2.6 Final - latest release April 7/08

Index: config.lasso
===================================================================
RCS file: /cvsroot/geeklog/Geeklog-1.x/public_html/fckeditor/editor/filemanager/connectors/lasso/config.lasso,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** config.lasso	9 Feb 2008 12:53:58 -0000	1.1
--- config.lasso	5 May 2008 00:35:25 -0000	1.2
***************
*** 2,6 ****
  /*
   * FCKeditor - The text editor for Internet - http://www.fckeditor.net
!  * Copyright (C) 2003-2007 Frederico Caldeira Knabben
   *
   * == BEGIN LICENSE ==
--- 2,6 ----
  /*
   * FCKeditor - The text editor for Internet - http://www.fckeditor.net
!  * Copyright (C) 2003-2008 Frederico Caldeira Knabben
   *
   * == BEGIN LICENSE ==
***************
*** 63,65 ****
  		)
  	);
! ]
\ No newline at end of file
--- 63,65 ----
  		)
  	);
! ]

Index: connector.lasso
===================================================================
RCS file: /cvsroot/geeklog/Geeklog-1.x/public_html/fckeditor/editor/filemanager/connectors/lasso/connector.lasso,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** connector.lasso	9 Feb 2008 12:53:58 -0000	1.1
--- connector.lasso	5 May 2008 00:35:25 -0000	1.2
***************
*** 2,6 ****
  /*
   * FCKeditor - The text editor for Internet - http://www.fckeditor.net
!  * Copyright (C) 2003-2007 Frederico Caldeira Knabben
   *
   * == BEGIN LICENSE ==
--- 2,6 ----
  /*
   * FCKeditor - The text editor for Internet - http://www.fckeditor.net
!  * Copyright (C) 2003-2008 Frederico Caldeira Knabben
   *
   * == BEGIN LICENSE ==
***************
*** 56,59 ****
--- 56,118 ----
  	);
  
+ 	/*.....................................................................
+ 	Custom tag sets the HTML response.
+ 	*/
+ 
+ 	define_tag(
+ 		'htmlreply',
+ 		-namespace='fck_',
+ 		-priority='replace',
+ 		-required='uploadResult',
+ 		-optional='NewFilePath',
+ 		-type='string',
+ 		-description='Sets the HTML response for the FCKEditor File Upload feature.'
+ 	);
+ 		$__html_reply__ = '\
+ <script type="text/javascript">
+ (function()
+ {
+ 	var d = document.domain ;
+ 
+ 	while ( true )
+ 	{
+ 		// Test if we can access a parent property.
+ 		try
+ 		{
+ 			var test = window.top.opener.document.domain ;
+ 			break ;
+ 		}
+ 		catch( e ) {}
+ 
+ 		// Remove a domain part: www.mytest.example.com => mytest.example.com => example.com ...
+ 		d = d.replace( /.*?(?:\\.|$)/, "" ) ;
+ 
+ 		if ( d.length == 0 )
+ 			break ;		// It was not able to detect the domain.
+ 
+ 		try
+ 		{
+ 			document.domain = d ;
+ 		}
+ 		catch (e)
+ 		{
+ 			break ;
+ 		}
+ 	}
+ })() ;
+ ';
+ 			if($uploadResult == '0' || $uploadResult == '201');
+ 			$__html_reply__ = $__html_reply__ + '\
+ 	window.parent.OnUploadCompleted(' + $uploadResult + ',\'' + $NewFilePath + '\',\'' + $NewFilePath->split('/')->last + '\');
+ </script>
+ 			';
+ 			else;
+ 			$__html_reply__ = $__html_reply__ + '\
+ 	window.parent.OnUploadCompleted(' + $uploadResult + ');
+ </script>
+ 			';
+ 			/if;
+ 	/define_tag;
+ 
  
      /*.....................................................................
***************
*** 64,70 ****
  	var('currentFolderURL' = $ServerPath
  		+ $config->find('Subdirectories')->find(action_param('Type'))
! 		+ action_param('CurrentFolder')
  	);
  
  
      /*.....................................................................
--- 123,141 ----
  	var('currentFolderURL' = $ServerPath
  		+ $config->find('Subdirectories')->find(action_param('Type'))
! 		+ $CurrentFolder
  	);
  
+ 	if($CurrentFolder->(Find: '..') || $CurrentFolder->(Find: '\\'));
+ 		if($Command == 'FileUpload');
+ 			$responseType = 'html';
+ 			$uploadResult = '102';
+ 			fck_htmlreply(
+ 				-uploadResult=$uploadResult
+ 			);
+ 		else;
+ 			$errorNumber = 102;
+ 			$commandData += '<Error number="' + $errorNumber + '" />\n';
+ 		/if;
+ 	else;
  
      /*.....................................................................
***************
*** 111,114 ****
--- 182,186 ----
              */
  			case('CreateFolder');
+ 				$NewFolderName = (String_ReplaceRegExp: $NewFolderName, -find='\\.|\\\\|\\/|\\||\\:|\\?|\\*|"|<|>', -replace='_');
  				var('newFolder' = $currentFolderURL + $NewFolderName + '/');
  				file_create($newFolder);
***************
*** 149,153 ****
                  Was a file actually uploaded?
                  */
! 				file_uploads->size ? $NewFile = file_uploads->get(1) | $uploadResult = '202';
  
  				if($uploadResult == '0');
--- 221,229 ----
                  Was a file actually uploaded?
                  */
!                 if(file_uploads->size);
!                 	$NewFile = file_uploads->get(1);
!                 else;
!                 	$uploadResult = '202';
!                 /if;
  
  				if($uploadResult == '0');
***************
*** 158,164 ****
--- 234,242 ----
                      */
  					$NewFileName = $NewFile->find('OrigName');
+ 					$NewFileName = (String_ReplaceRegExp: $NewFileName, -find='\\\\|\\/|\\||\\:|\\?|\\*|"|<|>', -replace='_');
  					$OrigFilePath = $currentFolderURL + $NewFileName;
  					$NewFilePath = $OrigFilePath;
  					local('fileExtension') = '.' + $NewFile->find('OrigExtension');
+ 					#fileExtension = (String_ReplaceRegExp: #fileExtension, -find='\\\\|\\/|\\||\\:|\\?|\\*|"|<|>', -replace='_');
  					local('shortFileName') = $NewFileName->removetrailing(#fileExtension)&;
  
***************
*** 192,220 ****
  								$OrigFilePath != $NewFilePath ? $uploadResult = 201;
  							case;
! 								$uploadResult = '202';
  						/select;
  					/if;
  				/if;
! 
! 
!                 /*.........................................................
!                 Set the HTML response.
!                 */
!                 if($uploadResult == '0' || $uploadResult == '201');
! 				$__html_reply__ = '\
! <script type="text/javascript">
! 	window.parent.frames[\'frmUpload\'].OnUploadCompleted(' + $uploadResult + ',\'' + $NewFilePath + '\',\'' + $NewFilePath->split('/')->last + '\');
! </script>
! 				';
!                 else;
! 				$__html_reply__ = '\
! <script type="text/javascript">
! 	window.parent.frames[\'frmUpload\'].OnUploadCompleted(' + $uploadResult + ');
! </script>
! 				';
! 				/if;
  		/select;
  	/inline;
! 
  
      /*.....................................................................
--- 270,284 ----
  								$OrigFilePath != $NewFilePath ? $uploadResult = 201;
  							case;
! 								$uploadResult = file_currenterror( -errorcode);
  						/select;
  					/if;
  				/if;
! 				fck_htmlreply(
! 					-uploadResult=$uploadResult,
! 					-NewFilePath=$NewFilePath
! 				);
  		/select;
  	/inline;
! 	/if;
  
      /*.....................................................................
***************
*** 235,257 ****
  Content-Type: text/xml; charset=utf-8
  [//lasso
! 		/header;
! 
  
!         /*.................................................................
!         Set the content type encoding for Lasso.
!         */
  		content_type('text/xml; charset=utf-8');
  
! 
!         /*.................................................................
!         Wrap the response as XML and output.
!         */
  		$__html_reply__ = '\
  <?xml version="1.0" encoding="utf-8" ?>
! <Connector command="' + $Command + '" resourceType="' + $Type + '">
! 	<CurrentFolder path="' + $CurrentFolder + '" url="' + $currentFolderURL + '" />
! ' + $commandData + '
! </Connector>
! 		';
  	/if;
  ]
--- 299,322 ----
  Content-Type: text/xml; charset=utf-8
  [//lasso
! /header;
  
! 		/*
! 			Set the content type encoding for Lasso.
! 		*/
  		content_type('text/xml; charset=utf-8');
  
! 		/*
! 			Wrap the response as XML and output.
! 		*/
  		$__html_reply__ = '\
  <?xml version="1.0" encoding="utf-8" ?>
! <Connector command="' + $Command + '" resourceType="' + $Type + '">';
! 
! 		if($errorNumber != '102');
! 			$__html_reply__ += '<CurrentFolder path="' + $CurrentFolder + '" url="' + $currentFolderURL + '" />';
! 		/if;
! 
! 		$__html_reply__ += $commandData + '
! </Connector>';
  	/if;
  ]

Index: upload.lasso
===================================================================
RCS file: /cvsroot/geeklog/Geeklog-1.x/public_html/fckeditor/editor/filemanager/connectors/lasso/upload.lasso,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** upload.lasso	9 Feb 2008 12:53:58 -0000	1.1
--- upload.lasso	5 May 2008 00:35:25 -0000	1.2
***************
*** 2,6 ****
  /*
   * FCKeditor - The text editor for Internet - http://www.fckeditor.net
!  * Copyright (C) 2003-2007 Frederico Caldeira Knabben
   *
   * == BEGIN LICENSE ==
--- 2,6 ----
  /*
   * FCKeditor - The text editor for Internet - http://www.fckeditor.net
!  * Copyright (C) 2003-2008 Frederico Caldeira Knabben
   *
   * == BEGIN LICENSE ==
***************
*** 57,61 ****
  	);
  
- 
  	/*.....................................................................
  	Custom tag sets the HTML response.
--- 57,60 ----
***************
*** 78,81 ****
--- 77,110 ----
  		$__html_reply__ = '\
  <script type="text/javascript">
+ (function()
+ {
+ 	var d = document.domain ;
+ 
+ 	while ( true )
+ 	{
+ 		// Test if we can access a parent property.
+ 		try
+ 		{
+ 			var test = window.top.opener.document.domain ;
+ 			break ;
+ 		}
+ 		catch( e ) {}
+ 
+ 		// Remove a domain part: www.mytest.example.com => mytest.example.com => example.com ...
+ 		d = d.replace( /.*?(?:\\.|$)/, "" ) ;
+ 
+ 		if ( d.length == 0 )
+ 			break ;		// It was not able to detect the domain.
+ 
+ 		try
+ 		{
+ 			document.domain = d ;
+ 		}
+ 		catch (e)
+ 		{
+ 			break ;
+ 		}
+ 	}
+ })() ;
  	window.parent.OnUploadCompleted(' + #errorNumber + ',"'
  		+ string_replace(#fileUrl, -find='"', -replace='\\"') + '","'
***************
*** 86,89 ****
--- 115,121 ----
  	/define_tag;
  
+ 	if($CurrentFolder->(Find: '..') || $CurrentFolder->(Find: '\\'));
+ 		$errorNumber = 102;
+ 	/if;
  
  	if($config->find('Enabled'));
***************
*** 95,99 ****
  			Was a file actually uploaded?
  			*/
! 			file_uploads->size ? $NewFile = file_uploads->get(1) | $errorNumber = 202;
  
  			if($errorNumber == 0);
--- 127,133 ----
  			Was a file actually uploaded?
  			*/
! 			if($errorNumber != '102');
! 				file_uploads->size ? $NewFile = file_uploads->get(1) | $errorNumber = 202;
! 			/if;
  
  			if($errorNumber == 0);




More information about the geeklog-cvs mailing list