+ /**
+ * @brief Remove image elements and replaces them with links to the image
+ *
+ * @param string $body
+ *
+ * @return string with replaced elements
+ */
+ private static function removePictures($body)
+ {
+ // Simplify image codes
+ $body = preg_replace("/\[img\=([0-9]*)x([0-9]*)\](.*?)\[\/img\]/ism", '[img]$3[/img]', $body);
+
+ $body = preg_replace("/\[url=([^\[\]]*)\]\[img\](.*)\[\/img\]\[\/url\]/Usi", '[url]$1[/url]', $body);
+ $body = preg_replace("/\[img\]([^\[\]]*)\[\/img\]/Usi", '[url]$1[/url]', $body);
+
+ return $body;
+ }
+