[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

CVS Update: gleipnir



Log Message:
-----------
Yes, there was a better way.

Modified Files:
--------------
    gleipnir/public_html/gallery:
        upload.pl

Revision Data
-------------
Index: upload.pl
===================================================================
RCS file: /cvs/gleipnir/public_html/gallery/upload.pl,v
retrieving revision 1.2
retrieving revision 1.3
diff -Lpublic_html/gallery/upload.pl -Lpublic_html/gallery/upload.pl -u -r1.2 -r1.3
--- public_html/gallery/upload.pl
+++ public_html/gallery/upload.pl
@@ -107,9 +107,7 @@
 	# Strip off slashes
 	$filename =~ s/.*[\/\\](.*)/$1/;
 
-	#Set the xtn to the last value, which we can assume is the file extension, this is pretty fug, there's probably a better way to do it.
-	my @filesp = split('.', $filename);
-	foreach my $cur (@filesp) { $xtn = $cur; }
+	$xtn = (split /\./, $filename)[-1];
 
 	# Copy our original image to somewhere safeish
 	open ( ORIGIMAGE, ">$originaldir/$id.$xtn" ) or $fail = 1;


Main Menu:

Site Tools:


Here, spammer, have some addresses.