You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@design1online the reason I said forward slashes because of how Stash deals with forward slashes and automatically grouping arrays. There's really no reason for a cache key to start or end with a forward slash as well.
I've never seen someone write keys like this:
user/1/
/user/1/
/user/1
There's no reason to write cache keys in stash like that at all. If you can give me a use case i'd be glad for you to give me a use case where it's appropriate to write any cache keys like that especially when the next line is an explode:
@design1online even when you use them based off class names, there's no reason to have forward slashes starting or ending in the key string.
namespace/subnamespace/classname
Anyways my concern with this issue is because Stash does not do checks for empty strings coming from forward slashes which causes problems when they explode a forward slash string and the key is empty.
eg.:
trim($key, '/ ')
Line: 107Because you can't trust the developer to do that every time when the library is expecting a certain type of string.
$key = " some/key";
would be considered an malformed string going through that method, though it's not always easily caught.The text was updated successfully, but these errors were encountered: