/** * Return true if xml property is valid */ protected function validateData(&$textbox1) { global $wgUser; if (!StructuredData::titleStringHasId($this->titleString)) { return false; } if (ESINHandler::hasAmbiguousDates($this->xml)) { return false; } if (!StructuredData::isRedirect($textbox1)) { $husbands = StructuredData::getTitlesAsArray($this->xml->husband); $wives = StructuredData::getTitlesAsArray($this->xml->wife); $children = StructuredData::getTitlesAsArray($this->xml->child); return !StructuredData::titlesOverlap($husbands, $wives) && !StructuredData::titlesOverlap($husbands, $children) && !StructuredData::titlesOverlap($wives, $children) && ($this->isGedcomPage || !StructuredData::titlesMissingId($husbands)) && ($this->isGedcomPage || !StructuredData::titlesMissingId($wives)) && ($this->isGedcomPage || !StructuredData::titlesMissingId($children)) && ($wgUser->isAllowed('patrol') || StructuredData::titlesExist(NS_PERSON, $husbands)) && ($wgUser->isAllowed('patrol') || StructuredData::titlesExist(NS_PERSON, $wives)) && ($wgUser->isAllowed('patrol') || StructuredData::titlesExist(NS_PERSON, $children)); } return true; }
/** * Return true if xml property is valid * textbox1 passed by reference for efficiency; don't change it */ protected function validateData(&$textbox1) { global $wgUser; if (!StructuredData::titleStringHasId($this->titleString)) { return false; } if (ESINHandler::hasAmbiguousDates($this->xml)) { return false; } if (!StructuredData::isRedirect($textbox1)) { $parentFamilies = StructuredData::getTitlesAsArray($this->xml->child_of_family); $spouseFamilies = StructuredData::getTitlesAsArray($this->xml->spouse_of_family); return !ESINHandler::isLiving($this->xml) && strlen((string) $this->xml->gender) > 0 && !StructuredData::titlesOverlap($parentFamilies, $spouseFamilies) && ($this->isGedcomPage || !StructuredData::titlesMissingId($parentFamilies)) && ($this->isGedcomPage || !StructuredData::titlesMissingId($spouseFamilies)) && ($wgUser->isAllowed('patrol') || StructuredData::titlesExist(NS_FAMILY, $parentFamilies)) && ($wgUser->isAllowed('patrol') || StructuredData::titlesExist(NS_FAMILY, $spouseFamilies)); } return true; }