Browse Source

Fixed error message when uploading a file

E_NOTICE (8)
Message: Only variables should be passed by reference
File: /var/www/epesi-live/modules/CRM/Contacts/Photo/Photo_0.php
Line=44

Error:
$extension = strtolower(end(explode('.', $oryg)));
fix:
 $file_ext = explode('.', $oryg);
$extension = strtolower(end($file_ext));

As per: https://vijayasankarn.wordpress.com/2017/08/28/php-only-variables-should-be-passed-by-reference/
master
Janusz Tylek 2 years ago
committed by GitHub
parent
commit
0b71d6d990
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      modules/CRM/Contacts/Photo/Photo_0.php

+ 2
- 1
modules/CRM/Contacts/Photo/Photo_0.php View File

@@ -41,7 +41,8 @@ class CRM_Contacts_Photo extends Module {
}
/* check extension */
$possible_extensions = array('jpg', 'jpeg', 'png');
$extension = strtolower(end(explode('.', $oryg)));
$file_ext = explode('.', $oryg);
$extension = strtolower(end($file_ext));
if( ! in_array($extension, $possible_extensions) ) {
echo __('Filename extension should be one of these (letter size doesn\'t matter): ').implode(', ', $possible_extensions);
return;


Loading…
Cancel
Save