summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--actions/newnotice.php8
1 files changed, 8 insertions, 0 deletions
diff --git a/actions/newnotice.php b/actions/newnotice.php
index c6c70e326..c014f1781 100644
--- a/actions/newnotice.php
+++ b/actions/newnotice.php
@@ -169,6 +169,14 @@ class NewnoticeAction extends Action
$location_id = $this->trimmed('location_id');
$location_ns = $this->trimmed('location_ns');
+ if (!empty($lat) && !empty($lon) && empty($location_id)) {
+ $location = Location::fromLatLon($lat, $lon);
+ if (!empty($location)) {
+ $location_id = $location->location_id;
+ $location_ns = $location->location_ns;
+ }
+ }
+
$upload = null;
$upload = MediaFile::fromUpload('attach');