diff --git a/core/basethemelet.class.php b/core/basethemelet.class.php
index 68678e06..de23c99b 100644
--- a/core/basethemelet.class.php
+++ b/core/basethemelet.class.php
@@ -67,7 +67,7 @@ class BaseThemelet {
$custom_classes = "";
if(class_exists("Relationships")){
if(property_exists($image, 'parent_id') && $image->parent_id !== NULL){ $custom_classes .= "shm-thumb-has_parent "; }
- if(property_exists($image, 'has_children') && $image->has_children == 'Y'){ $custom_classes .= "shm-thumb-has_child "; }
+ if(property_exists($image, 'has_children') && bool_escape($image->has_children)){ $custom_classes .= "shm-thumb-has_child "; }
}
return "".
diff --git a/ext/relatationships/main.php b/ext/relatationships/main.php
index 90875300..e81aefbb 100644
--- a/ext/relatationships/main.php
+++ b/ext/relatationships/main.php
@@ -89,7 +89,7 @@ class Relationships extends Extension {
public function onImageDeletion(ImageDeletionEvent $event) {
global $database;
- if($event->image->has_children == 'Y'){
+ if(bool_escape($event->image->has_children)){
$database->execute("UPDATE images SET parent_id = NULL WHERE parent_id = :iid", array("iid"=>$event->image->id));
}
diff --git a/ext/relatationships/theme.php b/ext/relatationships/theme.php
index 05e8a286..abc4302e 100644
--- a/ext/relatationships/theme.php
+++ b/ext/relatationships/theme.php
@@ -12,7 +12,7 @@ class RelationshipsTheme extends Themelet {
$page->add_block(new Block(null, "This post belongs to a $a.", "main", 5));
}
- if($image->has_children == 'Y'){
+ if(bool_escape($image->has_children)){
$ids = $database->get_col("SELECT id FROM images WHERE parent_id = :iid", array("iid"=>$image->id));
$html = "This post has id.'/1')."'>".(count($ids) > 1 ? "child posts" : "a child post")."";