]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/newnotice.php
Fix fatal error on OMB subscription for first-timers
[quix0rs-gnu-social.git] / actions / newnotice.php
index f677c49a96fc4de2fa160ecf5ad613dabbcd9dba..dd6da0b01c1b438f91b8904e5abb85bbbce4244c 100644 (file)
@@ -164,6 +164,11 @@ class NewnoticeAction extends Action
             $replyto = 'false';
         }
 
+        $lat = $this->trimmed('lat');
+        $lon = $this->trimmed('lon');
+        $location_id = $this->trimmed('location_id');
+        $location_ns = $this->trimmed('location_ns');
+
         $upload = null;
         $upload = MediaFile::fromUpload('attach');
 
@@ -183,7 +188,9 @@ class NewnoticeAction extends Action
         }
 
         $notice = Notice::saveNew($user->id, $content_shortened, 'web', 1,
-                                  ($replyto == 'false') ? null : $replyto);
+                                  ($replyto == 'false') ? null : $replyto,
+                                  null, null,
+                                  $lat, $lon, $location_id, $location_ns);
 
         if (isset($upload)) {
             $upload->attachToNotice($notice);
@@ -192,7 +199,9 @@ class NewnoticeAction extends Action
         common_broadcast_notice($notice);
 
         if ($this->boolean('ajax')) {
-            $this->startHTML('text/xml;charset=utf-8');
+            header('Content-Type: text/xml;charset=utf-8');
+            $this->xw->startDocument('1.0', 'UTF-8');
+            $this->elementStart('html');
             $this->elementStart('head');
             $this->element('title', null, _('Notice posted'));
             $this->elementEnd('head');