summaryrefslogtreecommitdiff
path: root/lib/common.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/common.php')
-rw-r--r--lib/common.php12
1 files changed, 8 insertions, 4 deletions
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