-
Notifications
You must be signed in to change notification settings - Fork 63
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
Develop anton #443
Develop anton #443
Conversation
lib/classes/compatibility/divi.php
Outdated
|
||
|
||
// maybe disable the filter | ||
add_filter('sanitize_file_name', array( $this, 'sanitize_file_name' ), 1); |
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.
You could have used stateless_skip_cache_busting
filter instead. Returning true will short-circuit the randomize_filename function.
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.
Ok, I'll check that filter. But don't understand now what exactly will short-circuit. Can you give an example?
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.
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.
Ah, I see now what you mean short-circuit. Will implement using that filter, thanks.
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.
@alimuzzaman I think there is some bug in this line https://github.com/wpCloud/wp-stateless/blob/a93638abe0d2ae5013e0c7f6f7155e8e101c0c33/lib/classes/class-utility.php#L80
It should return $filename
but not $return
. If you return $return
then the result of the randomize_filename
function will be 1
(casted from true)
Can you confirm this?
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.
Sorry, for the confusion. you should return unmodified $filename from the filter, not true. Then $return will become $filename.
I wrote like that so you can modify it from the filter if needed.
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.
Sorry, for the confusion. you should return unmodified $filename from the filter, not true. Then $return will become $filename.
I wrote like that so you can modify it from the filter.
Ok, makes sense. Better to keep it as is.
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.
I will add documentation in stateless_skip_cache_busting
filter.
* | ||
* @return bool | ||
*/ | ||
public static function isCallStackMatches( $callstack, $conditions ) { |
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.
Cool
Includes issues: