From ffaf4a551aa1dda969397aea1a36de5478033e98 Mon Sep 17 00:00:00 2001 From: tastytea Date: Mon, 4 Feb 2019 19:14:41 +0100 Subject: [PATCH] Bugfix: Do not assume client_id, client_secret and token are hexadecimal. --- CMakeLists.txt | 2 +- src/mastodon-cpp.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index dda71d5..850ef63 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required (VERSION 3.6) project (mastodon-cpp - VERSION 0.30.0 + VERSION 0.30.1 LANGUAGES CXX ) diff --git a/src/mastodon-cpp.cpp b/src/mastodon-cpp.cpp index e675063..402ef3f 100644 --- a/src/mastodon-cpp.cpp +++ b/src/mastodon-cpp.cpp @@ -182,8 +182,8 @@ uint_fast16_t API::register_app1(const string &client_name, if (ret == 0) { std::smatch match; - std::regex reid("client_id\":\"([0-9a-fA-F]+)\""); - std::regex resecret("client_secret\":\"([0-9a-fA-F]+)\""); + std::regex reid("client_id\":\"([^\"]+)\""); + std::regex resecret("client_secret\":\"([^\"]+)\""); std::regex_search(answer, match, reid); client_id = match[1].str(); @@ -244,7 +244,7 @@ uint_fast16_t API::register_app2(const string &client_id, if (ret == 0) { std::smatch match; - std::regex retoken("access_token\":\"([0-9a-fA-F]+)\""); + std::regex retoken("access_token\":\"([^\"]+)\""); std::regex_search(answer, match, retoken); access_token = match[1].str();