|
@@ -1,5 +1,6 @@
|
1
|
1
|
<?php
|
2
|
2
|
require_once "utils.php";
|
|
3
|
+require_once "misc/config.php";
|
3
|
4
|
|
4
|
5
|
function check_token()
|
5
|
6
|
{
|
|
@@ -24,6 +25,13 @@ function status_create()
|
24
|
25
|
$lat = check_float(get_post("latitude", false));
|
25
|
26
|
$long = check_float(get_post("longitude", false));
|
26
|
27
|
$media = null;
|
|
28
|
+ if (isset($_FILES["media"])
|
|
29
|
+ && getimagesize($_FILES["media"]["tmp_name"]) !== false)
|
|
30
|
+ {
|
|
31
|
+ global $media_path;
|
|
32
|
+ $media = $media_path . dechex(time());
|
|
33
|
+ move_uploaded_file($_FILES["media"]["tmp_name"], $media);
|
|
34
|
+ }
|
27
|
35
|
|
28
|
36
|
$u = database_exec("SELECT `id`, `username` FROM users WHERE `id` = ".
|
29
|
37
|
"(SELECT `user` FROM tokens WHERE `token` = :token)",
|