X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=blobdiff_plain;f=functions%2Fhtml.php;h=62733c4d814f8bbb88c6f1231407f51822f8dc0f;hp=b82dc5eefd9ad3ddebfaea305037f383cb5bbed3;hb=4b4abf93a9624311afef0c385023724ee46a2b60;hpb=d6c32258c05219670ab3b4ae2d460d844ea9a247 diff --git a/functions/html.php b/functions/html.php index b82dc5ee..62733c4d 100644 --- a/functions/html.php +++ b/functions/html.php @@ -3,14 +3,13 @@ /** * html.php * - * Copyright (c) 1999-2003 The SquirrelMail Project Team - * Licensed under the GNU GPL. For full terms see the file COPYING. - * * The idea is to inlcude here some functions to make easier * the right to left implementation by "functionize" some * html outputs. * - * $Id$ + * @copyright © 1999-2005 The SquirrelMail Project Team + * @license http://opensource.org/licenses/gpl-license.php GNU Public License + * @version $Id$ * @package squirrelmail */ @@ -51,7 +50,7 @@ function html_tag( $tag, // Tag to output } if ( $bgcolor <> '' ) { - $bgc = " bgcolor=\"$bgcolor\""; + $bgc = " bgcolor=\"$bgcolor\""; } switch ( $align ) { @@ -81,10 +80,10 @@ function html_tag( $tag, // Tag to output } if ( $val <> '' ) { - $ret .= ">$val"; + $ret .= ">$val\n"; } else { - $ret .= '>'; - } + $ret .= '>'. "\n"; + } return( $ret ); } @@ -93,14 +92,13 @@ function html_tag( $tag, // Tag to output /* especially usefull when $url = $PHP_SELF */ function set_url_var($url, $var, $val=0, $link=true) { $k = ''; - $ret = ''; $pat_a = array ( '/.+(\\&'.$var.')=(.*)\\&/AU', /* in the middle */ '/.+\\?('.$var.')=(.*\\&).+/AU', /* at front, more follow */ '/.+(\\?'.$var.')=(.*)$/AU', /* at front and only var */ '/.+(\\&'.$var.')=(.*)$/AU' /* at the end */ ); - preg_replace('/&/','&',$url); + preg_replace('/&/','&',$url); switch (true) { case (preg_match($pat_a[0],$url,$regs)): $k = $regs[1]; @@ -132,12 +130,15 @@ function html_tag( $tag, // Tag to output if ($k) { if ($val) { $rpl = "$k=$val"; - if ($link) { - $rpl = preg_replace('/&/','&',$rpl); - } + if ($link) { + $rpl = preg_replace('/&/','&',$rpl); + } } else { $rpl = ''; } + if( substr($v,-1)=='&' ) { + $rpl .= '&'; + } $pat = "/$k=$v/"; $url = preg_replace($pat,$rpl,$url); } @@ -151,7 +152,7 @@ function html_tag( $tag, // Tag to output function echo_template_var($var, $format_ar = array() ) { $frm_last = count($format_ar) -1; - if (isset($format_ar[0])) echo $format_ar[0]; + if (isset($format_ar[0])) echo $format_ar[0]; $i = 1; switch (true) { @@ -179,4 +180,4 @@ function html_tag( $tag, // Tag to output echo $format_ar[$frm_last]; } } -?> +?> \ No newline at end of file