From 793d48dc9e1d73d871bf34d9f7c1da8916134d1b Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Sat, 17 May 2008 21:55:51 -0400 Subject: smaller packet darcs-hash:20080518015551-84dde-65964e140ed0b6c23aeee368fcffccdc14d71c61.gz --- lib/common.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'lib/common.php') diff --git a/lib/common.php b/lib/common.php index e8a7ac6ae..03096260b 100644 --- a/lib/common.php +++ b/lib/common.php @@ -168,11 +168,15 @@ function common_menu_item($url, $text, $title=NULL) { common_element_end('li'); } -function common_input($id, $label) { +function common_input($id, $label, $value=NULL) { common_element('label', array('for' => $id), $label); - common_element('input', array('name' => $id, - 'type' => 'text', - 'id' => $id)); + $attrs = array('name' => $id, + 'type' => 'text', + 'id' => $id); + if ($value) { + $attrs['value'] = htmlspecialchars($value); + } + common_element('input', $attrs); } # salted, hashed passwords are stored in the DB -- cgit v1.2.3-54-g00ecf