protected function calcContentLength(AbstractRevision $revision)
 {
     if ($revision->isModerated() && !$revision->isLocked()) {
         return 0;
     } else {
         return $revision->getContentLength() ?: mb_strlen($revision->getContent('wikitext'));
     }
 }
 /**
  * @param IContextSource $context
  * @param AbstractRevision $newRevision
  * @param AbstractRevision|null $oldRevision
  * @param Title $title
  * @return Status
  */
 public function validate(IContextSource $context, AbstractRevision $newRevision, AbstractRevision $oldRevision = null, Title $title)
 {
     return $newRevision->getContentLength() > $this->maxLength ? Status::newFatal('flow-error-content-too-long', $this->maxLength) : Status::newGood();
 }