Skip to content
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

[Security] Fix usage of unexistent method in DoctrineAclCache. #11860

Closed
wants to merge 1 commit into from

Conversation

Projects
None yet
5 participants
@mauchede
Copy link

commented Sep 5, 2014

Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #10328
License MIT
Doc PR

The method deleteByPrefix does not exist. I replaced it by deleteAll: as @guilhermeblanco said, this method is not available in the interface Cache but it is present in the abstract class CacheProvider.

* @param PermissionGrantingStrategyInterface $permissionGrantingStrategy
* @param string $prefix
*
* @throws \InvalidArgumentException
*/
public function __construct(Cache $cache, PermissionGrantingStrategyInterface $permissionGrantingStrategy, $prefix = self::PREFIX)
public function __construct(CacheProvider $cache, PermissionGrantingStrategyInterface $permissionGrantingStrategy, $prefix = self::PREFIX)

This comment has been minimized.

Copy link
@stof

stof Sep 5, 2014

Member

this is a BC break

This comment has been minimized.

Copy link
@mauchede

mauchede Sep 5, 2014

Author

I added the BC instead of a checking of the cache class in clearCache. What do you suggest?

This comment has been minimized.

Copy link
@stof

stof Sep 5, 2014

Member

looks like you haven't pushed it

This comment has been minimized.

Copy link
@stof

stof Sep 5, 2014

Member

hmm, actually, I think your own sentence had a mistake, and so I understood it wrong.

your current PR does not add backward compatibility. It breaks it. and we will reject a PR which is not BC according to our policy (or actually let it wait until it is fixed)

This comment has been minimized.

Copy link
@romainneutron

romainneutron Sep 5, 2014

Member

@mauchede you could remove the type hint on the first argument and check $cache type in the constructor

@guilhermeblanco

This comment has been minimized.

Copy link
Contributor

commented Sep 5, 2014

We addressed this issue by introducing a https://github.com/doctrine/DoctrineCacheBundle
IMHO, since this is currently unusable, it should be removed. There's no way someone can use this class without experiencing E_FATAL.

@mauchede

This comment has been minimized.

Copy link
Author

commented Sep 5, 2014

@romainneutron : If I remove the type hint, we are not sure to have a CacheProvider (so not sure to have the method deleteAll).

@stof : I reverted the changes on constructor but I checked if the property cache inherits CacheProvider.

@stof

This comment has been minimized.

Copy link
Member

commented Sep 5, 2014

OK, 👍 for the current PR to avoid the E_FATAL

@mauchede

This comment has been minimized.

Copy link
Author

commented Sep 5, 2014

OK, so we agree: I never pushed a BC! ;)

@fabpot

This comment has been minimized.

Copy link
Member

commented Sep 5, 2014

👍

@fabpot

This comment has been minimized.

Copy link
Member

commented Sep 5, 2014

Thank you @mauchede.

fabpot added a commit that referenced this pull request Sep 5, 2014

bug #11860 [Security] Fix usage of unexistent method in DoctrineAclCa…
…che. (mauchede)

This PR was submitted for the master branch but it was merged into the 2.3 branch instead (closes #11860).

Discussion
----------

[Security] Fix usage of unexistent method in DoctrineAclCache.

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #10328
| License       | MIT
| Doc PR        |

The method `deleteByPrefix` does not exist. I replaced it by `deleteAll`: as @guilhermeblanco said, this method is not available in the interface `Cache` but it is present in the abstract class `CacheProvider`.

Commits
-------

131abd8 [Security] Fix usage of unexistent method in DoctrineAclCache.

@fabpot fabpot closed this Sep 5, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.