diff options
Diffstat (limited to 'includes/ContentHandler.php')
-rw-r--r-- | includes/ContentHandler.php | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/includes/ContentHandler.php b/includes/ContentHandler.php index b7761d63afcf..025c740c27a9 100644 --- a/includes/ContentHandler.php +++ b/includes/ContentHandler.php @@ -13,6 +13,18 @@ */ abstract class ContentHandler { + public static function getContentText( Content $content ) { + if ( !$content ) return ''; + + if ( $content instanceof TextContent ) { + #XXX: or check by model name? + #XXX: or define $content->allowRawData()? + return $content->getRawData(); + } + + return null; + } + public static function getDefaultModelFor( Title $title ) { global $wgNamespaceContentModels; |