use wcf\data\page\Page;
use wcf\data\page\PageCache;
use wcf\system\html\input\HtmlInputProcessor;
+use wcf\util\ArrayUtil;
/**
* Parses embedded pages and outputs their link or title.
* @inheritDoc
*/
public function validateValues($objectType, $objectID, array $values) {
+ // Pages can be referenced as `123#Some Text`, where everything after the number
+ // is a comment for better readability. Converting the values to integers via
+ // `intval()` will discard the everything after the ID.
+ $values = ArrayUtil::toIntegerArray($values);
+
return array_filter($values, function($value) {
return (PageCache::getInstance()->getPage($value) !== null);
});