summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpjmattal <pjmattal>2006-08-01 06:41:52 +0200
committerpjmattal <pjmattal>2006-08-01 06:41:52 +0200
commitffc0933126d113fc3c18ffc779ff1f9103908cc6 (patch)
treea1c74d78c6ca7ca9bb4b7715bb35b38e47ffdbb8
parent885f309fbacc61f996e6e448fdd5d9604b7c3c6d (diff)
downloadaur-ffc0933126d113fc3c18ffc779ff1f9103908cc6.tar.gz
aur-ffc0933126d113fc3c18ffc779ff1f9103908cc6.tar.xz
closed #2599: now removes " or ' from pkgdesc only if they form a start/end pair
-rw-r--r--web/html/pkgsubmit.php14
1 files changed, 12 insertions, 2 deletions
diff --git a/web/html/pkgsubmit.php b/web/html/pkgsubmit.php
index a76206e2..a3ac9ef7 100644
--- a/web/html/pkgsubmit.php
+++ b/web/html/pkgsubmit.php
@@ -237,9 +237,19 @@ if ($_COOKIE["AURSID"]) {
if (count($lparts) == 2) {
# this is a variable/value pair, strip out
# array parens and any quoting, except in pkgdesc
- #
+ # for pkgdesc, only remove start/end pairs of " or '
if ($lparts[0]=="pkgdesc") {
- $pkgbuild[$lparts[0]] = trim($lparts[1], "\"\' ");
+ if ($lparts[1]{0} == '"' &&
+ $lparts[1]{strlen($lparts[1])-1} == '"') {
+ $pkgbuild[$lparts[0]] = substr($lparts[1], 1, -1);
+ }
+ elseif
+ ($lparts[1]{0} == "'" &&
+ $lparts[1]{strlen($lparts[1])-1} == "'") {
+ $pkgbuild[$lparts[0]] = substr($lparts[1], 1, -1);
+ } else {
+ $pkgbuild[$lparts[0]] = $lparts[1];
+ }
} else {
$pkgbuild[$lparts[0]] = str_replace(array("(",")","\"","'"), "",
$lparts[1]);