| Conditions | 4 | 
| Paths | 3 | 
| Total Lines | 16 | 
| Code Lines | 7 | 
| Lines | 0 | 
| Ratio | 0 % | 
| Changes | 1 | ||
| Bugs | 0 | Features | 0 | 
| 1 | <?php  | 
            ||
| 49 | public function getPreviewURL()  | 
            ||
| 50 |     { | 
            ||
| 51 | // Use thumbnail url  | 
            ||
| 52 |         if ($this->embed->image) { | 
            ||
| 
                                                                                                    
                        
                         | 
                |||
| 53 | return $this->embed->image;  | 
            ||
| 54 | }  | 
            ||
| 55 | |||
| 56 | // Use direct image type  | 
            ||
| 57 |         if ($this->getType() === 'photo' && !empty($this->embed->url)) { | 
            ||
| 58 | return $this->embed->url;  | 
            ||
| 59 | }  | 
            ||
| 60 | |||
| 61 | // Default media  | 
            ||
| 62 |         return ModuleLoader::getModule('silverstripe/admin') | 
            ||
| 63 |             ->getResourcePath('client/dist/images/src/default_media.png'); | 
            ||
| 64 | }  | 
            ||
| 65 | |||
| 90 | 
In PHP, under loose comparison (like
==, or!=, orswitchconditions), values of different types might be equal.For
stringvalues, the empty string''is a special case, in particular the following results might be unexpected: