-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fixed ad blocking issue #9885
fixed ad blocking issue #9885
Conversation
loevgaard
commented
Oct 30, 2018
Q | A |
---|---|
Branch? | 1.2, 1.3, master |
Bug fix? | yes |
New feature? | no |
BC breaks? | no |
Deprecations? | no |
Related tickets | fixes #9884 |
License | MIT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the contribution!
It would be awesome, to test it somehow, but I do not see any easy way for it :(
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With some refactoring, we could extract path generation to a separate service and then easily mock the response... but I don't know should it be part of this PR :)
Well, basically the Or you could do what @Zales0123 says ;) Do you want to do any of this in this PR? If so I probably need some pointers as to where you want the |
We've just had a little discussion about this with @lchrusciel in the office 😄 We both think that service extraction would be the best choice, but on the other hand, it would be a BC break and lead to many extra things to do (deprecations, fallback to old function etc.)... I don't know is the value of such a test worth so many actions 😄 cc @Sylius/core-team |
Well, personally I probably wouldn't, but on the other hand it lowers the quality of this exact class ;) I don't know if you any system in place where you put issues like this for future implementation? :) |
The idea of extracting the path generation logic reminds me of a PR I made some time ago, #3703. |
*/ | ||
private function isAdBlockingProne(string $path): bool | ||
{ | ||
return stripos($path, 'ad') !== false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It filters out 11-12% of generated paths. Do adblockers block the images if ad
is the directory name or also if ad
is in the middle of a name?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need for case-insensitive check here though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As I mentioned in the intro I have not any ad blocker installed and I couldn't find any valid source when trying to google it, so basically I just made the assumption that it would filter both paths and filenames
Thanks, Joachim! 🥇 |
My pleasure! |