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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...