File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -112,32 +112,32 @@ public function isCorrectAnswer() {
112112 public function canMarkAnswer (\ElggUser $ user = null ) {
113113
114114 // check if we have a user
115- if (empty ($ user ) || !( $ user instanceof ElggUser) ) {
115+ if (empty ($ user )) {
116116 $ user = elgg_get_logged_in_user_entity ();
117117 }
118118
119119 if (empty ($ user )) {
120120 return false ;
121121 }
122122
123- $ container = $ this ->getContainerEntity ();
123+ $ question = $ this ->getContainerEntity ();
124124
125125 // are experts enabled
126126 if (!questions_experts_enabled ()) {
127127 // no, so only question owner can mark
128- return ($ user ->guid === $ container -> getOwnerGUID () );
128+ return ($ user ->guid === $ question -> owner_guid );
129129 }
130130
131131 // are only experts allowed to mark
132132 if (elgg_get_plugin_setting ('experts_mark ' , 'questions ' ) !== 'yes ' ) {
133133 // no, so the owner of a question can also mark
134- if ($ user ->getGUID () == $ container -> getOwnerGUID () ) {
134+ if ($ user ->guid == $ question -> owner_guid ) {
135135 return true ;
136136 }
137137 }
138138
139139 // is the user an expert
140- return questions_is_expert ($ container ->getContainerEntity (), $ user );
140+ return questions_is_expert ($ question ->getContainerEntity (), $ user );
141141 }
142142
143143 /**
You can’t perform that action at this time.
0 commit comments