Better error checking for content
rodzic
3b05ec48a1
commit
fad6ad7c20
12
index.php
12
index.php
|
@ -614,7 +614,17 @@ HTML;
|
||||||
if ( "Create" == $type || "Update" == $type || "Note" == $type ) {
|
if ( "Create" == $type || "Update" == $type || "Note" == $type ) {
|
||||||
// Get the HTML content
|
// Get the HTML content
|
||||||
// There is a slight difference between the formatting of sent and received messages
|
// There is a slight difference between the formatting of sent and received messages
|
||||||
"Note" == $type ? $content = $message["content"] : $content = $object["content"];
|
if ( "Note" == $type ) {
|
||||||
|
$content = $message["content"];
|
||||||
|
} else {
|
||||||
|
// If there is a content node
|
||||||
|
if ( isset ( $object["content"] ) ) {
|
||||||
|
$content = $object["content"];
|
||||||
|
} else {
|
||||||
|
// Anything weird will just get dumped to screen
|
||||||
|
htmlspecialchars( print_r( $object, true ) );
|
||||||
|
}
|
||||||
|
}
|
||||||
// Sanitise the HTML
|
// Sanitise the HTML
|
||||||
$content = strip_tags( $content, $allowed_elements );
|
$content = strip_tags( $content, $allowed_elements );
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue