getSubpagesForPages does not use constraints defined for for the subpages in question on checking wether a shortcut target is valid.
Before this fix the function getSubpagesForPages used the constaints given to filter the resulting subpages to also check if the target of a shortcut is vaild. The validity of a shortcut target (as the comment line above the function sall says: "If shortcut, look up if the target exists and is currently visible") should only depend on its existence and visibilty and not any other constraints used to filter the result of getSubpagesOfPages (e.g. a shortcut itself)
To test this create a shortcut to a page (visible in menu), activate the 'hidden in menu'-option for the page itself and use it in a generated menu.
* before: the shortcut would not be displayed as part of the menu
* after: the shortcut will now be displayed corrertly as part of the menu