]> git.mxchange.org Git - friendica.git/blobdiff - mod/profiles.php
Merge remote-tracking branch 'upstream/develop' into rewrites/coding-convention
[friendica.git] / mod / profiles.php
index d172febcfed8deba2208c4a50297e4a1465fd8c0..3d7e9fd96d3485f594de1e79f5c9abd7de2623fb 100644 (file)
@@ -234,11 +234,11 @@ function profiles_post(App $a) {
 
                $with = ((x($_POST,'with')) ? notags(trim($_POST['with'])) : '');
 
-               if (! strlen($howlong))
-                       $howlong = '0000-00-00 00:00:00';
-               else
+               if (! strlen($howlong)) {
+                       $howlong = NULL_DATE;
+               } else {
                        $howlong = datetime_convert(date_default_timezone_get(),'UTC',$howlong);
-
+               }
                // linkify the relationship target if applicable
 
                $withchanged = false;
@@ -248,11 +248,13 @@ function profiles_post(App $a) {
                                $withchanged = true;
                                $prf = '';
                                $lookup = $with;
-                               if (strpos($lookup,'@') === 0)
+                               if (strpos($lookup,'@') === 0) {
                                        $lookup = substr($lookup,1);
+                               }
                                $lookup = str_replace('_',' ', $lookup);
                                if (strpos($lookup,'@') || (strpos($lookup,'http://'))) {
                                        $newname = $lookup;
+                                       /// @TODO Maybe kill those error/debugging-surpressing @ characters
                                        $links = @Probe::lrdd($lookup);
                                        if (count($links)) {
                                                foreach ($links as $link) {
@@ -261,8 +263,7 @@ function profiles_post(App $a) {
                                                        }
                                                }
                                        }
-                               }
-                               else {
+                               } else {
                                        $newname = $lookup;
 /*                                     if (strstr($lookup,' ')) {
                                                $r = q("SELECT * FROM `contact` WHERE `name` = '%s' AND `uid` = %d LIMIT 1",
@@ -722,7 +723,7 @@ function profiles_content(App $a) {
                        '$gender' => gender_selector($r[0]['gender']),
                        '$marital' => marital_selector($r[0]['marital']),
                        '$with' => array('with', t("Who: \x28if applicable\x29"), strip_tags($r[0]['with']), t('Examples: cathy123, Cathy Williams, cathy@example.com')),
-                       '$howlong' => array('howlong', t('Since [date]:'), ($r[0]['howlong'] === '0000-00-00 00:00:00' ? '' : datetime_convert('UTC',date_default_timezone_get(),$r[0]['howlong']))),
+                       '$howlong' => array('howlong', t('Since [date]:'), ($r[0]['howlong'] <= NULL_DATE ? '' : datetime_convert('UTC',date_default_timezone_get(),$r[0]['howlong']))),
                        '$sexual' => sexpref_selector($r[0]['sexual']),
                        '$about' => array('about', t('Tell us about yourself...'), $r[0]['about']),
                        '$xmpp' => array('xmpp', t('XMPP (Jabber) address:'), $r[0]['xmpp'], t("The XMPP address will be propagated to your contacts so that they can follow you.")),