From: Pierre Habouzit (MadCoder Date: Mon, 13 Dec 2004 17:14:57 +0000 (+0000) Subject: refactor + validate.pl X-Git-Tag: xorg/old~659 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=2b8b9d6ec572c19267f9a8004578e105c4229396;p=platal.git refactor + validate.pl git-archimport-id: opensource@polytechnique.org--2005/platal--mainline--0.9--patch-89 --- diff --git a/bin/xhtml/validate.pl b/bin/xhtml/validate.pl index 48f4588..e8800e8 100755 --- a/bin/xhtml/validate.pl +++ b/bin/xhtml/validate.pl @@ -25,7 +25,7 @@ use HTTP::Request::Common 'POST'; print LWP::UserAgent ->new ->request( - POST 'http://amaretto.inria.fr:8080/w3c-markup-validator/check', + POST 'http://murphy.polytechnique.org/w3c-markup-validator/check', Content_Type => 'form-data', Content => [ output => 'xml', diff --git a/htdocs/vcard.php b/htdocs/vcard.php index 394b67d..121a8fc 100644 --- a/htdocs/vcard.php +++ b/htdocs/vcard.php @@ -23,21 +23,14 @@ require_once("xorg.inc.php"); new_nonhtml_page('vcard.tpl', AUTH_COOKIE); require_once("xorg.misc.inc.php"); -function format_adr($params, &$smarty) { +function format_adr($params, &$smarty) +{ // $adr1, $adr2, $adr3, $cp, $ville, $region, $pays extract($params['adr']); - $res = ";;"; - if (! empty($adr1)) $res .= "$adr1\n"; - if (! empty($adr2)) $res .= "$adr2\n"; - if (! empty($adr3)) $res .= "$adr3\n"; - if (! empty($adr1) || ! empty($adr2) || ! empty($adr3)) - $res = substr($res, 0, -1); - $res .= ";"; - if (! empty($ville)) $res .= "$ville;"; else $res .= ";"; - if (! empty($region)) $res .= "$region;"; else $res .= ";"; - if (! empty($cp)) $res .= "$cp;"; else $res .= ";"; - if (! empty($pays)) $res .= "$pays"; - return quoted_printable_encode($res); + $adr = $adr1; + $adr = trim("$adr\n$adr2"); + $adr = trim("$adr\n$adr3"); + return quoted_printable_encode(";;$adr;$ville;$region;$cp;$pays"); } $page->register_modifier('qp_enc', 'quoted_printable_encode');