Jump to content

Selector 'title=emptystring'


kixe
 Share

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
Link to comment
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
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...