Introduce ContentHandler::importTransform.
[lhc/web/wiklou.git] / includes / content / ContentHandler.php
index defa7da..212dfd1 100644 (file)
@@ -442,6 +442,21 @@ abstract class ContentHandler {
         */
        abstract public function unserializeContent( $blob, $format = null );
 
+       /**
+        * Apply import transformation (per default, returns $blob unchanged).
+        * This gives subclasses an opportunity to transform data blobs on import.
+        *
+        * @singe 1.24
+        *
+        * @param string $blob
+        * @param string|null $format
+        *
+        * @return string
+        */
+       public function importTransform( $blob, $format = null ) {
+               return $blob;
+       }
+
        /**
         * Creates an empty Content object of the type supported by this
         * ContentHandler.
@@ -454,7 +469,7 @@ abstract class ContentHandler {
 
        /**
         * Creates a new Content object that acts as a redirect to the given page,
-        * or null of redirects are not supported by this content model.
+        * or null if redirects are not supported by this content model.
         *
         * This default implementation always returns null. Subclasses supporting redirects
         * must override this method.