Jump to content
kixe

Selector 'title=emptystring'

Recommended Posts

Strange behaviour (lack of security?)
Using selector $pages->get('title=""') results in admin/access/roles/guest/
Result should be 0 (nullPage).

/*unexpected return*/
var_dump($pages->get('title=""')->id); // return 37
var_dump($pages->find('title=""')->each('id')
//return array(4) { [0]=> int(37) [1]=> int(38) [2]=> int(40) [3]=> int(41) }

/*expected return*/
var_dump($pages->get('id=""')->id); // return 0
var_dump($pages->get('name=""')->id); // return 0

Workaround

var_dump($pages->get('title="",has_parent!=2')->id); // return 0
var_dump($pages->get('name=""')->id); // return 0

Share this post


Link to post
Share on other sites

Is it the superuser who made the search ? If that's yes, it is working properly.

I don't see issues except when you do stupid things with the results.

  • Like 3

Share this post


Link to post
Share on other sites

:)

There are always executed checks like isViewable, isEditable, isWhatEverNeeded in the context of the current $user. So, everything is fine, if a Superuser is able to access those pages.

:)

Edited by horst
  • Like 3

Share this post


Link to post
Share on other sites

was the superuser. Thanks for the hint. :)
 

  • Like 2

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...