Extended profile - fix for unix epoc getting displayed for empty birthday and some validation issues

This commit is contained in:
Zach Copley 2011-03-16 10:58:13 -07:00
parent 5e40450efd
commit 405dae87b1
2 changed files with 25 additions and 22 deletions

View File

@ -395,6 +395,8 @@ class ExtendedProfileWidget extends Form
{
$this->out->elementStart('div', 'education-item');
$this->out->element('div', 'label', _m('Institution'));
if (!empty($field['school'])) {
$this->out->element('div', 'field', $field['school']);
$this->out->element('div', 'label', _m('Degree'));
$this->out->element('div', 'field', $field['degree']);
@ -414,6 +416,7 @@ class ExtendedProfileWidget extends Form
date('j M Y', strtotime($field['end'])
)
);
}
$this->out->elementEnd('div');
}
@ -564,10 +567,11 @@ class ExtendedProfileWidget extends Form
$out->input($id, null, $this->ext->getTextValue($name));
break;
case 'date':
$value = $this->ext->getDateValue($name);
$out->input(
$id,
null,
date('j M Y', strtotime($this->ext->getDateValue($name)))
empty($value) ? null : date('j M Y', strtotime($value))
);
break;
case 'person':

View File

@ -260,8 +260,7 @@ class ProfileDetailSettingsAction extends ProfileSettingsAction
$this->removeAll($user, 'website');
$i = 0;
foreach($sites as $site) {
if (!Validate::uri(
if (!empty($site['value']) && !Validate::uri(
$site['value'],
array('allowed_schemes' => array('http', 'https')))
) {