mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
pkgsubmit.php: Move URL protocol check down
Move all PKGBUILD field validations to a central location. Also, change $pkgbuild[] to $new_pkgbuild[] in order to parse evaluated PKGBUILD fields instead of raw ones. Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
This commit is contained in:
parent
4bb6e88742
commit
1f27b2fb9b
1 changed files with 12 additions and 14 deletions
|
@ -211,20 +211,6 @@ if ($uid):
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# TODO This is where other additional error checking can be
|
|
||||||
# performed. Examples: #md5sums == #sources?, md5sums of any
|
|
||||||
# included files match?, install scriptlet file exists?
|
|
||||||
#
|
|
||||||
|
|
||||||
# Check for http:// or other protocol in url
|
|
||||||
#
|
|
||||||
if (!$error) {
|
|
||||||
$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 "eval" and simple substituions.
|
# Now, run through the pkgbuild array, and do "eval" and simple substituions.
|
||||||
if (!$error) {
|
if (!$error) {
|
||||||
while (list($k, $v) = each($pkgbuild)) {
|
while (list($k, $v) = each($pkgbuild)) {
|
||||||
|
@ -288,6 +274,18 @@ if ($uid):
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Check for http:// or other protocol in url
|
||||||
|
if (!$error) {
|
||||||
|
$parsed_url = parse_url($new_pkgbuild['url']);
|
||||||
|
if (!$parsed_url['scheme']) {
|
||||||
|
$error = __("Package URL is missing a protocol (ie. http:// ,ftp://)");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# TODO: This is where other additional error checking can be
|
||||||
|
# performed. Examples: #md5sums == #sources?, md5sums of any
|
||||||
|
# included files match?, install scriptlet file exists?
|
||||||
|
|
||||||
# The DB schema imposes limitations on number of allowed characters
|
# The DB schema imposes limitations on number of allowed characters
|
||||||
# Print error message when these limitations are exceeded
|
# Print error message when these limitations are exceeded
|
||||||
if (!$error) {
|
if (!$error) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue