Projet

Général

Profil

Révision 7b2d1845

Ajouté par Assos Assos il y a presque 4 ans

Weekly update of contrib modules

Voir les différences:

drupal7/sites/all/modules/file_entity/file_entity.module
1265 1265
 * @return string
1266 1266
 *   Returns the replaced title text.
1267 1267
 */
1268
function file_entity_replace_title($file, $replace_options = [], $title = NULL, $langcode = NULL) {
1269
  $replace_options += [
1268
function file_entity_replace_title($file, $replace_options = array(), $title = NULL, $langcode = NULL) {
1269
  $replace_options += array(
1270 1270
    'clear' => TRUE,
1271 1271
    'sanitize' => FALSE,
1272
  ];
1272
  );
1273 1273

  
1274 1274
  $title_default = '[file:field_file_image_title_text]';
1275 1275
  if (!isset($title)) {
......
1282 1282
    return $title_items ? $title_items[0]['value'] : '';
1283 1283
  }
1284 1284
  elseif (!empty($title)) {
1285
    $token_replaced = token_replace($title, ['file' => $file], $replace_options);
1285
    $token_replaced = token_replace($title, array('file' => $file), $replace_options);
1286 1286
    return decode_entities($token_replaced); // Filter out possible XSS.
1287 1287
  }
1288 1288

  
......
1304 1304
 * @return string
1305 1305
 *   Returns the replaced alt text.
1306 1306
 */
1307
function file_entity_replace_alt($file, $replace_options = [], $alt = NULL, $langcode = NULL) {
1308
  $replace_options += [
1307
function file_entity_replace_alt($file, $replace_options = array(), $alt = NULL, $langcode = NULL) {
1308
  $replace_options += array(
1309 1309
    'clear' => TRUE,
1310 1310
    'sanitize' => FALSE,
1311
  ];
1311
  );
1312 1312

  
1313 1313
  $alt_default = '[file:field_file_image_alt_text]';
1314 1314

  
......
1323 1323
    return $alt_items ? $alt_items[0]['value'] : '';
1324 1324
  }
1325 1325
  elseif (!empty($alt)) {
1326
    $token_replaced = token_replace($alt, ['file' => $file], $replace_options);
1326
    $token_replaced = token_replace($alt, array('file' => $file), $replace_options);
1327 1327
    return decode_entities($token_replaced); // Filter out possible XSS.
1328 1328
  }
1329 1329

  

Formats disponibles : Unified diff