find_string & replace_string had special case when merging them.
But it failed when merging multiple times some site config.
Update it to a bit more complex solution to ensure find_string & replace_string aren't duplicated when merging config multiple times.
We can't perform an array_unique on these values (looks like fabrizio got the point years ago) mostly because replace_string can have same values, example:
To fix that issue, we combine find & replace as key & value in one array, we merge them (so we can't have duplicates keys) and then rebuild find & replace string in the current config.
@fivefilters, you might be interested by applying that fix on FullTextRSS I think.
Coverage increased (+0.02%) to 96.531% when pulling 9336ff5ccf618404b3579ffcdf4e413a93dcc3d8 on fix-bad-merge-find-replace-string into 36a0f614cbc684997f6e9f72e1c37273e491b8e5 on master.
find_string
&replace_string
had special case when merging them. But it failed when merging multiple times some site config.Update it to a bit more complex solution to ensure
find_string
&replace_string
aren't duplicated when merging config multiple times.We can't perform an
array_unique
on these values (looks like fabrizio got the point years ago) mostly becausereplace_string
can have same values, example:To fix that issue, we combine find & replace as key & value in one array, we merge them (so we can't have duplicates keys) and then rebuild find & replace string in the current config.
@fivefilters, you might be interested by applying that fix on FullTextRSS I think.
Fix https://github.com/wallabag/wallabag/issues/4025