Projet

Général

Profil

Révision 211d6cee

Ajouté par Assos Assos il y a environ 6 ans

Weekly update of contrib modules

Voir les différences:

drupal7/sites/all/modules/file_entity/file_entity.tokens.inc
284 284
 * Either a single value, the first of the array, or an array of values.
285 285
 */
286 286
function _file_entity_tokens_get_property($files, $property, $array_handler = 'first') {
287

  
287
  $value = NULL;
288 288
  // If we only need the first variable
289 289
  $return_first = ($array_handler == 'first' || empty($array_handler) || $array_handler == 'value:0');
290 290

  
......
302 302

  
303 303
    // If values are: image, height, width, https-image
304 304
    elseif (!empty($info[$file['fid']])) {
305
      $value = isset($info[$file['fid']][$property]) ?: NULL;
305
      if (isset($info[$file['fid']][$property])) {
306
        $value = $info[$file['fid']][$property];
307
      } else {
308
        $value = NULL;
309
      }
306 310
    }
307 311
    // If values are files types
308 312
    else {
......
329 333
        $info[$file['fid']]['https-image'] = str_replace('http://', 'https://', $info[$file['fid']]['image']);
330 334
      }
331 335

  
332
      $value = isset($info[$file['fid']][$property]) ?: NULL;
336
      if (isset($info[$file['fid']][$property])) {
337
        $value = $info[$file['fid']][$property];
338
      } else {
339
        $value = NULL;
340
      }
333 341
    }
334 342

  
335 343
    if ($return_first) {

Formats disponibles : Unified diff