Browse Source

Cleanup old code

pull/183/head
Timothée Jaussoin 10 years ago
parent
commit
dfd187421d
  1. 28
      app/helpers/StringHelper.php
  2. 8
      app/models/message/Message.php

28
app/helpers/StringHelper.php

@ -105,18 +105,6 @@ function prepareString($string, $large = false, $preview = false) {
return trim($string);
}
/**
* Fix self-closing tags
*/
function fixSelfClosing($string) {
return preg_replace_callback('/<([^\s<]+)\/>/',
function($match) {
return '<'.$match[1].'></'.$match[1].'>';
}
, $string);
}
/**
* @desc Escape the unescaped ampersand
*/
@ -127,22 +115,6 @@ function escapeAmpersands($string) {
$string);
}
/**
* Remove the content, body and html tags
*/
function cleanHTMLTags($string) {
return str_replace(
array(
'<content type="html">',
'<html xmlns="http://jabber.org/protocol/xhtml-im">',
'<body xmlns="http://www.w3.org/1999/xhtml">',
'</body>',
'</html>',
'</content>'),
'',
$string);
}
/**
* Return an array of informations from a XMPP uri
*/

8
app/models/message/Message.php

@ -107,14 +107,6 @@ class Message extends Model {
}
}
/*if($stanza->html) {
$this->html = \cleanHTMLTags($stanza->html->body->asXML());
$this->html = \fixSelfClosing($this->html);
$this->html = \prepareString($this->html, false, $images);
} else {*/
// $this->html = \prepareString($this->body, false, $images);
//}
if($stanza->replace) {
$this->newid = $this->id;
$this->id = (string)$stanza->replace->attributes()->id;

Loading…
Cancel
Save