line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
################################################################################### |
3
|
|
|
|
|
|
|
# |
4
|
|
|
|
|
|
|
# Embperl - Copyright (c) 1997-2008 Gerald Richter / ecos gmbh www.ecos.de |
5
|
|
|
|
|
|
|
# Embperl - Copyright (c) 2008-2014 Gerald Richter |
6
|
|
|
|
|
|
|
# |
7
|
|
|
|
|
|
|
# You may distribute under the terms of either the GNU General Public |
8
|
|
|
|
|
|
|
# License or the Artistic License, as specified in the Perl README file. |
9
|
|
|
|
|
|
|
# |
10
|
|
|
|
|
|
|
# THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR |
11
|
|
|
|
|
|
|
# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED |
12
|
|
|
|
|
|
|
# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13
|
|
|
|
|
|
|
# |
14
|
|
|
|
|
|
|
# $Id: Util.pm 1578075 2014-03-16 14:01:14Z richter $ |
15
|
|
|
|
|
|
|
# |
16
|
|
|
|
|
|
|
################################################################################### |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
package Embperl::Util ; |
20
|
|
|
|
|
|
|
|
21
|
1
|
|
|
1
|
|
6
|
use strict ; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
44
|
|
22
|
1
|
|
|
1
|
|
5
|
use vars qw{@AliasScalar @AliasHash @AliasArray %NameSpace} ; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
422
|
|
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
####################################################################################### |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub AddCompartment ($) |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
{ |
29
|
1
|
|
|
1
|
0
|
744
|
my ($sName) = @_ ; |
30
|
1
|
|
|
|
|
3
|
my $cp ; |
31
|
|
|
|
|
|
|
|
32
|
1
|
50
|
|
|
|
8
|
return $cp if (defined ($cp = $NameSpace{$sName})) ; |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
#eval 'require Safe' ; |
35
|
|
|
|
|
|
|
#die "require Safe failed: $@" if ($@); |
36
|
1
|
|
|
|
|
1474
|
require Safe ; |
37
|
|
|
|
|
|
|
|
38
|
1
|
|
|
|
|
37180
|
$cp = new Safe ($sName) ; |
39
|
|
|
|
|
|
|
|
40
|
1
|
|
|
|
|
1043
|
$NameSpace{$sName} = $cp ; |
41
|
|
|
|
|
|
|
|
42
|
1
|
|
|
|
|
5
|
return $cp ; |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
####################################################################################### |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
sub MailFormTo |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
{ |
50
|
0
|
|
|
0
|
0
|
0
|
$Embperl::req -> app -> mail_form_to (@_) ; |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
####################################################################################### |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
@AliasScalar = qw{row col cnt tabmode escmode req_rec maxrow maxcol req_rec |
57
|
|
|
|
|
|
|
dbgAll dbgAllCmds dbgCmd dbgDefEval dbgEarlyHttpHeader |
58
|
|
|
|
|
|
|
dbgEnv dbgEval dbgFlushLog dbgFlushOutput dbgForm |
59
|
|
|
|
|
|
|
dbgFunc dbgHeadersIn dbgImport dbgInput dbgLogLink |
60
|
|
|
|
|
|
|
dbgMem dbgProfile dbgShowCleanup dbgSource dbgStd |
61
|
|
|
|
|
|
|
dbgSession dbgTab dbgWatchScalar dbgParse dbgObjectSearch |
62
|
|
|
|
|
|
|
optDisableChdir optDisableEmbperlErrorPage optReturnError optDisableFormData |
63
|
|
|
|
|
|
|
optDisableHtmlScan optDisableInputScan optDisableMetaScan optDisableTableScan |
64
|
|
|
|
|
|
|
optDisableSelectScan optDisableVarCleanup optEarlyHttpHeader optOpcodeMask |
65
|
|
|
|
|
|
|
optRawInput optSafeNamespace optSendHttpHeader optAllFormData |
66
|
|
|
|
|
|
|
optRedirectStdout optUndefToEmptyValue optNoHiddenEmptyValue optAllowZeroFilesize |
67
|
|
|
|
|
|
|
optKeepSrcInMemory optKeepSpaces optOpenLogEarly optNoUncloseWarn |
68
|
|
|
|
|
|
|
_ep_node |
69
|
|
|
|
|
|
|
} ; |
70
|
|
|
|
|
|
|
@AliasHash = qw{fdat udat mdat sdat idat http_headers_out fsplitdat} ; |
71
|
|
|
|
|
|
|
@AliasArray = qw{ffld param} ; |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
####################################################################################### |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
sub CreateAliases |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
{ |
80
|
66
|
|
|
66
|
0
|
3400
|
my $package = caller ; |
81
|
|
|
|
|
|
|
|
82
|
66
|
|
|
|
|
136
|
my $dummy ; |
83
|
|
|
|
|
|
|
|
84
|
1
|
|
|
1
|
|
6
|
no strict ; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
586
|
|
85
|
|
|
|
|
|
|
|
86
|
66
|
50
|
|
|
|
109
|
if (!defined(${"$package\:\:row"})) |
|
66
|
|
|
|
|
863
|
|
87
|
|
|
|
|
|
|
{ # create new aliases for Embperl magic vars |
88
|
|
|
|
|
|
|
|
89
|
66
|
|
|
|
|
176
|
foreach (@AliasScalar) |
90
|
|
|
|
|
|
|
{ |
91
|
3894
|
|
|
|
|
3886
|
*{"$package\:\:$_"} = \${"Embperl\:\:$_"} ; |
|
3894
|
|
|
|
|
14583
|
|
|
3894
|
|
|
|
|
8750
|
|
92
|
3894
|
|
|
|
|
4025
|
$dummy = ${"$package\:\:$_"} ; # necessary to make sure variable exists! |
|
3894
|
|
|
|
|
13859
|
|
93
|
|
|
|
|
|
|
} |
94
|
66
|
|
|
|
|
162
|
*{"$package\:\:epreq"} = \$Embperl::req ; |
|
66
|
|
|
|
|
281
|
|
95
|
66
|
|
|
|
|
146
|
*{"$package\:\:epapp"} = \$Embperl::app ; |
|
66
|
|
|
|
|
232
|
|
96
|
|
|
|
|
|
|
|
97
|
66
|
|
|
|
|
151
|
foreach (@AliasHash) |
98
|
|
|
|
|
|
|
{ |
99
|
462
|
|
|
|
|
850
|
*{"$package\:\:$_"} = \%{"Embperl\:\:$_"} ; |
|
462
|
|
|
|
|
1865
|
|
|
462
|
|
|
|
|
1040
|
|
100
|
|
|
|
|
|
|
} |
101
|
66
|
|
|
|
|
201
|
foreach (@AliasArray) |
102
|
|
|
|
|
|
|
{ |
103
|
132
|
|
|
|
|
184
|
*{"$package\:\:$_"} = \@{"Embperl\:\:$_"} ; |
|
132
|
|
|
|
|
496
|
|
|
132
|
|
|
|
|
333
|
|
104
|
|
|
|
|
|
|
} |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
|
107
|
66
|
|
|
|
|
137
|
my $sess ; |
108
|
66
|
|
|
|
|
464
|
$sess = $Embperl::req -> app -> udat ; |
109
|
66
|
50
|
|
|
|
212
|
*{"$package\:\:udat"} = $sess if ($sess) ; |
|
0
|
|
|
|
|
0
|
|
110
|
66
|
|
|
|
|
383
|
$sess = $Embperl::req -> app -> mdat ; |
111
|
66
|
50
|
|
|
|
175
|
*{"$package\:\:mdat"} = $sess if ($sess) ; |
|
0
|
|
|
|
|
0
|
|
112
|
66
|
|
|
|
|
281
|
$sess = $Embperl::req -> app -> sdat ; |
113
|
66
|
50
|
|
|
|
165
|
*{"$package\:\:sdat"} = $sess if ($sess) ; |
|
0
|
|
|
|
|
0
|
|
114
|
|
|
|
|
|
|
|
115
|
66
|
|
|
|
|
134
|
*{"$package\:\:exit"} = \&Embperl::exit ; |
|
66
|
|
|
|
|
287
|
|
116
|
66
|
|
|
|
|
134
|
*{"$package\:\:MailFormTo"} = \&Embperl::Util::MailFormTo ; |
|
66
|
|
|
|
|
420
|
|
117
|
66
|
|
|
|
|
123
|
*{"$package\:\:Execute"} = \&Embperl::Req::ExecuteComponent ; |
|
66
|
|
|
|
|
282
|
|
118
|
|
|
|
|
|
|
|
119
|
66
|
|
|
|
|
100
|
tie *{"$package\:\:LOG"}, 'Embperl::Log' ; |
|
66
|
|
|
|
|
665
|
|
120
|
66
|
|
|
|
|
135
|
tie *{"$package\:\:OUT"}, 'Embperl::Out' ; |
|
66
|
|
|
|
|
634
|
|
121
|
|
|
|
|
|
|
|
122
|
66
|
|
|
|
|
114
|
my $addcleanup = \%{"$package\:\:CLEANUP"} ; |
|
66
|
|
|
|
|
323
|
|
123
|
66
|
|
|
|
|
170
|
$addcleanup -> {'CLEANUP'} = 0 ; |
124
|
66
|
|
|
|
|
167
|
$addcleanup -> {'EXPIRES'} = 0 ; |
125
|
66
|
|
|
|
|
139
|
$addcleanup -> {'CACHE_KEY'} = 0 ; |
126
|
66
|
|
|
|
|
114
|
$addcleanup -> {'OUT'} = 0 ; |
127
|
66
|
|
|
|
|
197949
|
$addcleanup -> {'LOG'} = 0 ; |
128
|
|
|
|
|
|
|
} |
129
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
|
131
|
|
|
|
|
|
|
|
132
|
1
|
|
|
1
|
|
6
|
use strict ; |
|
1
|
|
|
|
|
9
|
|
|
1
|
|
|
|
|
213
|
|
133
|
|
|
|
|
|
|
} |
134
|
|
|
|
|
|
|
|
135
|
|
|
|
|
|
|
####################################################################################### |
136
|
|
|
|
|
|
|
|
137
|
|
|
|
|
|
|
1; |