From 356e97f41192e0c3eab3a08a1615c98c40672930 Mon Sep 17 00:00:00 2001 From: moneroexamples Date: Sun, 24 Apr 2016 11:57:48 +0800 Subject: [PATCH] trim spaces from search value added --- src/page.h | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/page.h b/src/page.h index f60c5e6..32d6871 100644 --- a/src/page.h +++ b/src/page.h @@ -859,8 +859,10 @@ namespace xmreg { } string - search(const string& search_text) + search(string search_text) { + // remove white characters + boost::trim(search_text); string result_html {"No such thing found: " + search_text}; @@ -869,13 +871,13 @@ namespace xmreg { if (search_text.size() < 12) { result_html = show_block(boost::lexical_cast(search_text)); - } - // nasty check if output is "Cant get" as a sign of - // a not found tx. Later need to think of something better. - if (result_html.find("Cant get") == string::npos) - { - return result_html; + // nasty check if output is "Cant get" as a sign of + // a not found tx. Later need to think of something better. + if (result_html.find("Cant get") == string::npos) + { + return result_html; + } } // second let try searching for tx