]> git.mxchange.org Git - friendica.git/blobdiff - mod/profiles.php
Remove/replace killme() with *exit()
[friendica.git] / mod / profiles.php
index 459a1c5e75a73fc1e0030933fe2d051499b6d0f9..b30739b30459acf29119b96d94744d42480b775c 100644 (file)
@@ -117,7 +117,7 @@ function profiles_init(App $a) {
                );
                if(! DBA::isResult($r1)) {
                        notice(L10n::t('Profile unavailable to clone.') . EOL);
-                       killme();
+                       exit();
                        return;
                }
                unset($r1[0]['id']);
@@ -150,7 +150,7 @@ function profiles_init(App $a) {
                );
                if (! DBA::isResult($r)) {
                        notice(L10n::t('Profile not found.') . EOL);
-                       killme();
+                       exit();
                        return;
                }
 
@@ -216,7 +216,7 @@ function profiles_post(App $a) {
                } else {
                        $ignore_year = false;
                }
-               if (!in_array($dob, ['0000-00-00', '0001-01-01'])) {
+               if (!in_array($dob, ['0000-00-00', DBA::NULL_DATE])) {
                        if (strpos($dob, '0000-') === 0 || strpos($dob, '0001-') === 0) {
                                $ignore_year = true;
                                $dob = substr($dob, 5);
@@ -251,7 +251,7 @@ function profiles_post(App $a) {
                $marital = Strings::escapeTags(trim($_POST['marital']));
                $howlong = Strings::escapeTags(trim($_POST['howlong']));
 
-               $with = ((x($_POST,'with')) ? Strings::escapeTags(trim($_POST['with'])) : '');
+               $with = (!empty($_POST['with']) ? Strings::escapeTags(trim($_POST['with'])) : '');
 
                if (! strlen($howlong)) {
                        $howlong = DBA::NULL_DATETIME;
@@ -618,11 +618,11 @@ function profiles_content(App $a) {
                        '$postal_code' => ['postal_code', L10n::t('Postal/Zip Code:'), $r[0]['postal-code']],
                        '$country_name' => ['country_name', L10n::t('Country:'), $r[0]['country-name']],
                        '$age' => ((intval($r[0]['dob'])) ? '(' . L10n::t('Age: ') . Temporal::getAgeByTimezone($r[0]['dob'],$a->user['timezone'],$a->user['timezone']) . ')' : ''),
-                       '$gender' => ContactSelector::gender($r[0]['gender']),
-                       '$marital' => ['selector' => ContactSelector::maritalStatus($r[0]['marital']), 'value' => $r[0]['marital']],
+                       '$gender' => L10n::t(ContactSelector::gender($r[0]['gender'])),
+                       '$marital' => ['selector' => ContactSelector::maritalStatus($r[0]['marital']), 'value' => L10n::t($r[0]['marital'])],
                        '$with' => ['with', L10n::t("Who: \x28if applicable\x29"), strip_tags($r[0]['with']), L10n::t('Examples: cathy123, Cathy Williams, cathy@example.com')],
                        '$howlong' => ['howlong', L10n::t('Since [date]:'), ($r[0]['howlong'] <= DBA::NULL_DATETIME ? '' : DateTimeFormat::local($r[0]['howlong']))],
-                       '$sexual' => ['selector' => ContactSelector::sexualPreference($r[0]['sexual']), 'value' => $r[0]['sexual']],
+                       '$sexual' => ['selector' => ContactSelector::sexualPreference($r[0]['sexual']), 'value' => L10n::t($r[0]['sexual'])],
                        '$about' => ['about', L10n::t('Tell us about yourself...'), $r[0]['about']],
                        '$xmpp' => ['xmpp', L10n::t("XMPP \x28Jabber\x29 address:"), $r[0]['xmpp'], L10n::t("The XMPP address will be propagated to your contacts so that they can follow you.")],
                        '$homepage' => ['homepage', L10n::t('Homepage URL:'), $r[0]['homepage']],