From ffc0933126d113fc3c18ffc779ff1f9103908cc6 Mon Sep 17 00:00:00 2001 From: pjmattal Date: Tue, 1 Aug 2006 04:41:52 +0000 Subject: closed #2599: now removes " or ' from pkgdesc only if they form a start/end pair --- web/html/pkgsubmit.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'web') diff --git a/web/html/pkgsubmit.php b/web/html/pkgsubmit.php index a76206e..a3ac9ef 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]); -- cgit v1.2.3-54-g00ecf