[prev in list] [next in list] [prev in thread] [next in thread] 

List:       lon-capa-cvs
Subject:    [LON-CAPA-cvs] cvs: loncom /publisher loncfile.pm
From:       albertel <lon-capa-cvs-allow () mail ! lon-capa ! org>
Date:       2007-03-30 20:37:32
Message-ID: cvsalbertel1175287052 () cvsserver
[Download RAW message or body]

albertel		Fri Mar 30 16:37:32 2007 EDT

  Modified files:              
    /loncom/publisher	loncfile.pm 
  Log:
  - filenames can have perios in the directory names, need to only strip the filename
  
  
Index: loncom/publisher/loncfile.pm
diff -u loncom/publisher/loncfile.pm:1.80 loncom/publisher/loncfile.pm:1.81
--- loncom/publisher/loncfile.pm:1.80	Wed Dec 20 17:41:08 2006
+++ loncom/publisher/loncfile.pm	Fri Mar 30 16:37:31 2007
@@ -9,7 +9,7 @@
 #  and displays a page showing the results of the action.
 #
 #
-# $Id: loncfile.pm,v 1.80 2006/12/20 22:41:08 albertel Exp $
+# $Id: loncfile.pm,v 1.81 2007/03/30 20:37:31 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -749,16 +749,16 @@
 	    return;
 	}
 	if ($newfilename !~ /\Q.$extension\E$/) {
-	    if ($newfilename =~ m|^[^\.]*\.([^\.]+)$|) {
+	    if ($newfilename =~ m|/[^/.]*\.(?:[^/.]+)$|) {
 		#already has an extension strip it and add in expected one
-		$newfilename =~ s|.([^\.]+)$||;
+		$newfilename =~ s|(/[^./])\.(?:[^.]+)$|$1|;
 	    }
 	    $newfilename.=".$extension";
 	}
     }
     my $result=&exists($user,$domain,$newfilename);
     if($result) {
-	$request->print('<font color="red">'.$result.'</font></form>');
+	$request->print('<span class="LC_error">'.$result.'</span></form>');
     } else {
 	$request->print('<p>'.&mt('Make new file').' '.&display($newfilename).'?</p>');
 	$request->print('</form>');


_______________________________________________
LON-CAPA-cvs mailing list
LON-CAPA-cvs@mail.lon-capa.org
http://mail.lon-capa.org/mailman/listinfo/lon-capa-cvs
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic