Added more default replacements (AMP)

This commit is contained in:
tastytea 2018-08-19 21:24:57 +02:00
parent 73ddaf2776
commit 3a44361bf7
Signed by: tastytea
GPG Key ID: CFC39497F1B26E07
1 changed files with 4 additions and 2 deletions

View File

@ -111,12 +111,14 @@ const void init_replacements()
Json::Value &config = configfile.get_json(); Json::Value &config = configfile.get_json();
if (config["replace"].isNull()) if (config["replace"].isNull())
{ {
const std::array<const replace_pair, 5> replace_array = const std::array<const replace_pair, 6> replace_array =
{{ {{
{ "[\\?&]utm_[^&]+", "" }, // Google { "[\\?&]utm_[^&]+", "" }, // Google
{ "[\\?&]wt_?[^&]+", "" }, // Twitter? { "[\\?&]wt_?[^&]+", "" }, // Twitter?
{ "[\\?&]__twitter_impression=[^&]+", "" }, // Twitter? { "[\\?&]__twitter_impression=[^&]+", "" }, // Twitter?
{ "//amp\\.", "//" } // AMP { "//amp\\.", "//" }, // AMP
{ "/amp/", "" }, // AMP
{ "[\\?&]service=amp", "" } // AMP
}}; }};
for (const replace_pair &pair : replace_array) for (const replace_pair &pair : replace_array)