Schrift
Wiki:Tipp zum Debugging: use Data::Dumper; local $Data::Dumper::Useqq = 1; print Dumper \@var;
[thread]10975[/thread]

VERIABLE IN CONFIG-DATEI EINBAUEN

Leser: 1


<< >> 3 Einträge, 1 Seite
diaz1983
 2007-12-07 20:38
#103593 #103593
User since
2007-12-06
1 Artikel
BenutzerIn
[default_avatar]
Hallo Leute...

Hier müsste ich eine per GET-Methode übergebene Variable einbauen...

Kann mir jemand helfen und mir zeigen, wie ich $_GET["pd"] (PHP Syntax) in Perl einbaue...

Siehe Zeile:
upload_dir => $ENV{'DOCUMENT_ROOT'} . '/uploads/' . $_GET["pd"] . '/',


GANZE CONFIGDATEI:

package uu_default_config;
use strict;
use Exporter;

@uu_default_config::ISA = qw( Exporter );
@uu_default_config::EXPORT = qw($config);

use vars qw($config);

$config = {
config_file_name => 'uu_default_config',
temp_dir => '/tmp/',
upload_dir => $ENV{'DOCUMENT_ROOT'} . '/uploads/' . $_GET["pd"] . '/',
unique_upload_dir => 0,
unique_upload_dir_length => 16,
unique_file_name => 0,
unique_file_name_length => 16,
max_upload => 107374182400,
overwrite_existing_files => 0,
redirect_after_upload => 0,
param_dir => '/tmp/',
pass_param_dir => 1,
redirect_url => 'http:///' . $ENV{'SERVER_NAME'} . '/uu_finished.php',
redirect_using_js_html => 1,
redirect_using_html => 0,
redirect_using_js => 0,
redirect_using_location => 0,
get_data_speed => 1000,
disallow_extensions => '(sh|php|php3|php4|php5|py|shtml|phtml|cgi|pl|plx|htaccess|htpasswd)',
allow_extensions => '(jpg|jpeg|gif|bmp|rar|zip|gzip|7z|tiff|tif|psd)',
normalize_file_names => 1,
normalize_file_delimiter => '_',
normalize_file_length => 48,
link_to_upload => 0,
path_to_upload => 'http:///'. $ENV{'SERVER_NAME'} . '/uploads/',
send_email_on_upload => 0,
html_email_support => 0,
link_to_upload_in_email => 0,
email_subject => 'Uber File Upload',
to_email_address => 'office@powerdruck.com,office@powerdruck.com',
from_email_address => 'office@powerdruck.com',
log_uploads => 0,
log_params => 0,
log_dir => '/tmp/uu_logs/',
};

1;
ptk
 2007-12-07 22:08
#103598 #103598
User since
2003-11-28
3645 Artikel
ModeratorIn
[default_avatar]
Code: (dl )
upload_dir => $ENV{'DOCUMENT_ROOT'} . '/uploads/' . $_GET["pd"] . '/',

Das sieht ja nach einem Sicherheitsloch aus ... ein Verzeichnis anhand von Benutzereingaben auswählen???
Bitte benutz den Taint-Modus von perl!
GwenDragon
 2007-12-07 22:10
#103600 #103600
User since
2005-01-17
14759 Artikel
Admin1
[Homepage]
user image
Damit holst du dir den CGI-Parameter pd
Code (perl): (dl )
1
2
3
4
use CGI;
my $cgi = new CGI;
my $pd;
$pd = $cgi->param("pd") if $cgi->request_method() eq 'GET'; 
<< >> 3 Einträge, 1 Seite



View all threads created 2007-12-07 20:38.