Андрей (andy) wrote in changelog,
Андрей
andy
changelog

[livejournal] r21499: LJSUP-11530 (prepare LJ code to run on d...

Committer: ailyin
LJSUP-11530 (prepare LJ code to run on debian squeeze)
U   trunk/cgi-bin/Apache/LiveJournal.pm
Modified: trunk/cgi-bin/Apache/LiveJournal.pm
===================================================================
--- trunk/cgi-bin/Apache/LiveJournal.pm	2012-03-21 15:19:34 UTC (rev 21498)
+++ trunk/cgi-bin/Apache/LiveJournal.pm	2012-03-22 06:02:37 UTC (rev 21499)
@@ -6,9 +6,10 @@
 use strict;
 no warnings 'uninitialized';
 
+use Carp();
 use Compress::Zlib;
 use Digest::MD5 qw( md5_base64 md5_hex );
-use Carp();
+use File::Spec;
 
 use lib "$ENV{LJHOME}/cgi-bin";
 use LJ::Request;
@@ -1395,10 +1396,11 @@
         }
     }
 
-    if ( $host eq $LJ::DOMAIN_WEB && ( my $uri = LJ::Request->uri ) ) {
-        my $filename_full = $LJ::HTDOCS . $uri;
-        $filename_full =~ s{//}{/}g;
-        if ( $filename_full =~ /[.]bml$/ && -e $filename_full ) {
+    my $uri = LJ::Request->uri;
+    if ( $host eq $LJ::DOMAIN_WEB && defined $uri && $uri =~ /[.]bml$/ ) {
+        my $filename_full = File::Spec->catfile( $LJ::HTDOCS, $uri );
+        ($filename_full) = File::Spec->no_upwards($filename_full);
+        if ( defined $filename_full && -e $filename_full ) {
             return $bml_handler->($filename_full);
         }
     }

Tags: ailyin, andy, livejournal, pm
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments