~ubuntu-branches/ubuntu/natty/moin/natty-updates

« back to all changes in this revision

Viewing changes to wiki/htdocs/applets/FCKeditor/editor/filemanager/browser/default/connectors/perl/util.pl

  • Committer: Bazaar Package Importer
  • Author(s): Jonas Smedegaard
  • Date: 2008-06-22 21:17:13 UTC
  • mto: This revision was merged to the branch mainline in revision 18.
  • Revision ID: james.westby@ubuntu.com-20080622211713-inlv5k4eifxckelr
ImportĀ upstreamĀ versionĀ 1.7.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#####
 
2
#  FCKeditor - The text editor for internet
 
3
#  Copyright (C) 2003-2005 Frederico Caldeira Knabben
 
4
#  
 
5
#  Licensed under the terms of the GNU Lesser General Public License:
 
6
#               http://www.opensource.org/licenses/lgpl-license.php
 
7
#  
 
8
#  For further information visit:
 
9
#               http://www.fckeditor.net/
 
10
#  
 
11
#  "Support Open Source software. What about a donation today?"
 
12
#  
 
13
#  File Name: util.pl
 
14
#       This is the File Manager Connector for Perl.
 
15
#  
 
16
#  File Authors:
 
17
#               Takashi Yamaguchi (jack@omakase.net)
 
18
#####
 
19
 
 
20
sub RemoveFromStart
 
21
{
 
22
        local($sourceString, $charToRemove) = @_;
 
23
        $sPattern = '^' . $charToRemove . '+' ;
 
24
        $sourceString =~ s/^$charToRemove+//g;
 
25
        return $sourceString;
 
26
}
 
27
 
 
28
sub RemoveFromEnd
 
29
{
 
30
        local($sourceString, $charToRemove) = @_;
 
31
        $sPattern = $charToRemove . '+$' ;
 
32
        $sourceString =~ s/$charToRemove+$//g;
 
33
        return $sourceString;
 
34
}
 
35
 
 
36
sub ConvertToXmlAttribute
 
37
{
 
38
        local($value) = @_;
 
39
        return $value;
 
40
#       return utf8_encode(htmlspecialchars($value));
 
41
 
 
42
}
 
43
 
 
44
sub specialchar_cnv
 
45
{
 
46
        local($ch) = @_;
 
47
 
 
48
        $ch =~ s/&/&/g;             # &
 
49
        $ch =~ s/\"/"/g;   #"
 
50
        $ch =~ s/\'/'/g;    # '
 
51
        $ch =~ s/</&lt;/g;              # <
 
52
        $ch =~ s/>/&gt;/g;              # >
 
53
        return($ch);
 
54
}
 
55
 
 
56
1;