Skip to content

Commit

Permalink
bug safety ald get_class
Browse files Browse the repository at this point in the history
  • Loading branch information
petazeta committed Nov 23, 2021
1 parent 17a1f12 commit 77521f6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions server/php/includes/safety.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ function __construct(){
}
private function gettablename($myelement){
if (gettype($myelement)=="string") return $myelement; //It is the table name
if (get_class($myelement)=="NodeFemale") {
if (Node::detectGender($myelement)=="NodeFemale") {
return $myelement->props->childtablename;
}
else if (get_class($myelement)=="NodeMale") {
else if (Node::detectGender($myelement)=="NodeMale") {
return $myelement->parentNode->props->childtablename;
}
else {
Expand Down Expand Up @@ -41,7 +41,7 @@ private function is_admin($user) {
}
private function is_owner($myelement, $user_id) {
//user relationship case
if (get_class($myelement)=="NodeFemale") {
if (Node::detectGender($myelement)=="NodeFemale") {
if ($myelement->props->parenttablename=="TABLE_USERS") {
if ($myelement->partnerNode && $myelement->partnerNode->props->id == $user_id) return true;
}
Expand Down

0 comments on commit 77521f6

Please sign in to comment.