]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Extended profile - fix for unix epoc getting displayed for empty birthday and some...
authorZach Copley <zach@status.net>
Wed, 16 Mar 2011 17:58:13 +0000 (10:58 -0700)
committerZach Copley <zach@status.net>
Wed, 16 Mar 2011 17:58:13 +0000 (10:58 -0700)
plugins/ExtendedProfile/extendedprofilewidget.php
plugins/ExtendedProfile/profiledetailsettingsaction.php

index 80d88a9599b3cd7f0e5d0176726626892e3b0a9f..b507713f06c2fcfd65a730dac4f42d73c5a69824 100644 (file)
@@ -395,25 +395,28 @@ class ExtendedProfileWidget extends Form
     {
         $this->out->elementStart('div', 'education-item');
         $this->out->element('div', 'label', _m('Institution'));
-        $this->out->element('div', 'field', $field['school']);
-        $this->out->element('div', 'label', _m('Degree'));
-        $this->out->element('div', 'field', $field['degree']);
-        $this->out->element('div', 'label', _m('Description'));
-        $this->out->element('div', 'field', $field['description']);
-        $this->out->element('div', 'label', _m('Start'));
-        $this->out->element(
-            'div',
-            array('class' => 'field date'),
-            date('j M Y', strtotime($field['start'])
-            )
-        );
-        $this->out->element('div', 'label', _m('End'));
-        $this->out->element(
-            'div',
-            array('class' => 'field date'),
-            date('j M Y', strtotime($field['end'])
-            )
-        );
+        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']);
+            $this->out->element('div', 'label', _m('Description'));
+            $this->out->element('div', 'field', $field['description']);
+            $this->out->element('div', 'label', _m('Start'));
+            $this->out->element(
+                'div',
+                array('class' => 'field date'),
+                date('j M Y', strtotime($field['start'])
+                )
+            );
+            $this->out->element('div', 'label', _m('End'));
+            $this->out->element(
+                'div',
+                array('class' => 'field date'),
+                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':
index 4d716ec32c8b2bd9df344d1bb78f69ceffb7a659..4a2045cefb6077bcd2c1e7545147a9f275d82f34 100644 (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')))
             ) {