diff --git a/CLI/FetchToncoinTransactions.php b/CLI/FetchToncoinTransactions.php index 11bfa417..f6a2fb56 100755 --- a/CLI/FetchToncoinTransactions.php +++ b/CLI/FetchToncoinTransactions.php @@ -47,7 +47,7 @@ class FetchToncoinTransactions extends Command } $testnetSubdomain = OPENVK_ROOT_CONF["openvk"]["preferences"]["ton"]["testnet"] ? "testnet." : ""; - $url = "https://" . $testnetSubdomain . "toncenter.com/api/v2/getTransactions?"; + $url = "https://" . $testnetSubdomain . "toncenter.com/api/v2/getTransactions?"; $opts = [ "http" => [ @@ -57,14 +57,14 @@ class FetchToncoinTransactions extends Command ]; $selection = $this->transactions->select('hash, lt')->order("id DESC")->limit(1)->fetch(); - $trHash = $selection->hash ?? NULL; - $trLt = $selection->lt ?? NULL; + $trHash = $selection->hash ?? NULL; + $trLt = $selection->lt ?? NULL; $data = http_build_query([ "address" => OPENVK_ROOT_CONF["openvk"]["preferences"]["ton"]["address"], - "limit" => 100, - "hash" => $trHash, - "to_lt" => $trLt + "limit" => 100, + "hash" => $trHash, + "to_lt" => $trLt ]); $response = file_get_contents($url . $data, false, stream_context_create($opts)); @@ -72,13 +72,13 @@ class FetchToncoinTransactions extends Command $header->writeln("Gonna up the balance of users"); foreach($response["result"] as $transfer) { - $output_array; - preg_match('/' . OPENVK_ROOT_CONF["openvk"]["preferences"]["ton"]["regex"] . '/', $transfer["in_msg"]["message"], $output_array); - $userid = ctype_digit($output_array[1]) ? intval($output_array[1]) : NULL; - if(is_null($userid)) { + $outputArray; + preg_match('/' . OPENVK_ROOT_CONF["openvk"]["preferences"]["ton"]["regex"] . '/', $transfer["in_msg"]["message"], $outputArray); + $userId = ctype_digit($outputArray[1]) ? intval($outputArray[1]) : NULL; + if(is_null($userId)) { $header->writeln("Well, that's a donation. Thanks! XD"); } else { - $user = (new Users)->get($userid); + $user = (new Users)->get($userId); if(!$user) { $header->writeln("Well, that's a donation. Thanks! XD"); } else { diff --git a/Web/Presenters/WallPresenter.php b/Web/Presenters/WallPresenter.php index ee3cc651..0dd6b66d 100644 --- a/Web/Presenters/WallPresenter.php +++ b/Web/Presenters/WallPresenter.php @@ -272,15 +272,14 @@ final class WallPresenter extends OpenVKPresenter $this->flashFail("err", tr("failed_to_publish_post"), tr("post_is_empty_or_too_big")); try { - $post = new Post; - - $post->setOwner($this->user->id); - $post->setWall($wall); - $post->setCreated(time()); - $post->setContent($this->postParam("text")); - $post->setAnonymous($anon); - $post->setFlags($flags); - $post->setNsfw($this->postParam("nsfw") === "on"); + $post = new Post; + $post->setOwner($this->user->id); + $post->setWall($wall); + $post->setCreated(time()); + $post->setContent($this->postParam("text")); + $post->setAnonymous($anon); + $post->setFlags($flags); + $post->setNsfw($this->postParam("nsfw") === "on"); $post->save(); } catch (\LengthException $ex) { $this->flashFail("err", tr("failed_to_publish_post"), tr("post_is_too_big")); diff --git a/Web/static/js/al_wall.js b/Web/static/js/al_wall.js index 4a8ab4e9..d9dba115 100644 --- a/Web/static/js/al_wall.js +++ b/Web/static/js/al_wall.js @@ -104,7 +104,7 @@ function setupWallPostInputHandlers(id) { u(input).trigger("change"); } }); - + u("#wall-post-input" + id).on("input", function(e) { var boost = 5; var textArea = e.target;