[Sprint/SillySheep](fix): Failing spam detection on staging causing issues when uploading media #1193
Closes #1193
Summary
Following an update to the spam detection system, videos stopped working because the spam detector was expecting an Entity object rather than the Video that our media POST was passing to it. The same applies to an Image object being passed through.
This caused an issue where-in ->getDescription() could not be found - as Video has the description attribute, I added getters and setters into the Video and Image classes.
Testing
Test various upload types, try posting with and without a red flag failing link (e.g. bit.ly).
added scoped labels
added scoped label and automatically removed label
added 1 commit
- 27039ee4 - Added description getter and setters for images
changed title from : Failing spam detection media to : Failing spam detection media
changed the description
added scoped label and automatically removed label
approved this merge request
- Developer
Feels like there is a couple hundred milliseconds of lag at the end of the progress bar just before a image uploads but seems more stable than previously.
296 296 $this->time_sent = $time_sent; 297 297 return $this; 298 298 } 299 300 /** 301 * Return description 302 * @return string 303 */ 304 public function getDescription(): string 305 { 306 return $this->description ?: ''; 307 } 308 309 /** 310 * Set description 311 * @return Image - Owner
386 386 $this->time_sent = $time_sent; 387 387 return $this; 388 388 } 389 390 391 /** 392 * Return description 393 * @return string 394 */ 395 public function getDescription(): string 396 { 397 return $this->description ?: ''; 398 } 399 400 /** 401 * Set description - Owner
param type
added scoped label and automatically removed label
- Owner
We need to use method_exists on https://gitlab.com/minds/engine/blob/master/Core/Security/Spam.php#L32