From 01be3a4893ec16321473d772db777bc710c9df66 Mon Sep 17 00:00:00 2001 From: simo Date: Thu, 30 Jun 2005 23:17:50 +0000 Subject: Task #2838 - URL protocol checking to avoid broken links --- web/html/pkgsubmit.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/web/html/pkgsubmit.php b/web/html/pkgsubmit.php index 4faedd0..e56335d 100644 --- a/web/html/pkgsubmit.php +++ b/web/html/pkgsubmit.php @@ -292,8 +292,14 @@ if ($_COOKIE["AURSID"]) { # performed. Examples: #md5sums == #sources?, md5sums of any # included files match?, install scriptlet file exists? # - - + + # Check for http:// or other protocol in url + # + $parsed_url = parse_url($pkgbuild['url']); + if (!$parsed_url['scheme']) { + $error = __("Package URL is missing a protocol (ie. http:// ,ftp://)"); + } + # Now, run through the pkgbuild array and do any $pkgname/$pkgver # substituions. # -- cgit v1.2.3-70-g09d2