package IIc4465d99e56b7bc627a7b42ab7169f3a::EncURL; use strict; use II535843728d21206bdd21a2a084373080; use II4212c07ddfb1652c969722f1a6817994; use IIb39071a48a82a07eeb9256f406abebc5; our $DBTable = "zen_controller_encurl"; II4212c07ddfb1652c969722f1a6817994->setErrorHandler("table '[\\w\\-]+\.$DBTable' doesn't exist", sub
{ my ($dbc, $qr, $params) = @_; $dbc->do(<<END);
CREATE TABLE $DBTable (
code     VARCHAR(30) NOT NULL PRIMARY KEY, data     TEXT, otime    TIMESTAMP NULL
) ENGINE=MyISAM
END
$dbc->do($qr, $params); return 1; }); sub process { my $class = shift; my ($controller, $request, $url) = @_; my ($code) = $url =~ /^(\w+)(?:\.\w+)?$/; my $dbc = II982446f8950cc3dc59e487adba22df54::lllllIllIlIllllI($II982446f8950cc3dc59e487adba22df54::lIlIllIlIlIIlIll{$IIb39071a48a82a07eeb9256f406abebc5::lIIIlIllllIIlIll},994,$II982446f8950cc3dc59e487adba22df54::lIlIllIlIlIIlIll{$IIb39071a48a82a07eeb9256f406abebc5::IIllllIIllIlIlll})->get; my $data = $dbc->getValue("SELECT data FROM $DBTable WHERE code=" . $dbc->quote($code)) or $request->bluescreen('input', 'invalid or expired URL'); $data = { map { II720d6e18aa34327713eb014408fc9144::IlllIllllIllIIIl($II720d6e18aa34327713eb014408fc9144::lIIIlllIllIIlllI{$II720d6e18aa34327713eb014408fc9144::IIIllIIlIlllIIll},1004,$II720d6e18aa34327713eb014408fc9144::lIIIlllIllIIlllI{$II720d6e18aa34327713eb014408fc9144::lIIlllIllIlIllll})->extrScalar($_) } split(':', $data) }; $ENV{PATH_INFO}	= $data->{PATH_INFO}; $ENV{QUERY_STRING} = $data->{QUERY_STRING}; die "endless loop" if $ENV{PATH_INFO} =~ m|^/encurl/|; $controller->processRequest($request); return; } sub create { my ($class, $path_info, $query_string, $script_name) = @_; $script_name ||= $ENV{SCRIPT_NAME}; my %data = ( PATH_INFO => "$path_info", QUERY_STRING => "$query_string", ); my $data = join ':', map { IIb39071a48a82a07eeb9256f406abebc5::IIllIIIIIIlIIlII($II8dae0e141ee45f5daba6a74e4a7c3b6f::lIlllIIIlIlIlIII{$II720d6e18aa34327713eb014408fc9144::lIIIIIlIIIlIIIII},1004,$II8dae0e141ee45f5daba6a74e4a7c3b6f::lIlllIIIlIlIlIII{$II720d6e18aa34327713eb014408fc9144::lIIIlIIIllIlllII})->packScalar($_) } %data; my $code = II720d6e18aa34327713eb014408fc9144::llllllIlIIIIllll($II720d6e18aa34327713eb014408fc9144::lIIIlllIllIIlllI{$II8dae0e141ee45f5daba6a74e4a7c3b6f::IlIllIIlIllIlIIl},1020,$II720d6e18aa34327713eb014408fc9144::lIIIlllIllIIlllI{$II8dae0e141ee45f5daba6a74e4a7c3b6f::IllllIIIIIlIllIl})->generate; my $dbc = II982446f8950cc3dc59e487adba22df54::IIllIIllIIIlllll($II720d6e18aa34327713eb014408fc9144::IllIllllIIIlIIlI{$IIb39071a48a82a07eeb9256f406abebc5::IlIlIIIIlllIIIlI},994,$II720d6e18aa34327713eb014408fc9144::IllIllllIIIlIIlI{$IIb39071a48a82a07eeb9256f406abebc5::IIllllIIllIlIlll})->get; $dbc->do(sprintf("INSERT INTO $DBTable (code,data) VALUES (%s,%s)", $dbc->quote($code), $dbc->quote($data))); $dbc->do("DELETE FROM $DBTable WHERE DATE_ADD(otime, INTERVAL 24 HOUR) < NOW()"); $dbc->setErrorHandler(undef); my ($ext) = $path_info =~ /(\.\w+)$/; my $proto = $ENV{HTTPS} eq 'on' ? 'https://' : 'http://'; return "$proto$ENV{HTTP_HOST}$script_name/encurl/$code$ext"; } 1; 