From 3a3c6b5ba10155dfb581ef8551d507a5712d1900 Mon Sep 17 00:00:00 2001 From: Colin Smith Date: Fri, 22 Jul 2005 03:54:31 +0000 Subject: [PATCH] Clean up get_filename_from_url. --- etc/inc/pfsense-utils.inc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/etc/inc/pfsense-utils.inc b/etc/inc/pfsense-utils.inc index 484b864d72..bb055caa3a 100644 --- a/etc/inc/pfsense-utils.inc +++ b/etc/inc/pfsense-utils.inc @@ -492,9 +492,7 @@ function add_text_to_file($file, $text) { * get_filename_from_url($url): converts a url to its filename. */ function get_filename_from_url($url) { - $filenamesplit = split("/", $url); - foreach($filenamesplit as $fn) $filename = $fn; - return $filename; + return array_pop(explode("/", $filename)); } /* @@ -988,4 +986,4 @@ function generate_random_mac() { return $mac; } -?> \ No newline at end of file +?>