Форумы / Cotonti / Support / Error in plugin userimages

SergeySt
#1 12.09.2014 06:27

On server appears file error_log:

PHP Strict Standards:  Only variables should be passed by reference in /home/********/public_html/plugins/userimages/userimages.profile.update.php on line 33

This file - userimages.profile.update.php - hasn't been changed or modified by me, this is system file.

I think that this happens after user uploads his photo or avatar to his profile.

This thing doesn't change anything on site, so everything works fine and photo uploads for user. But in this log file new line is appeared and it's happening everytime new photo is uploaded.

Please, solve this problem. If you need more information to solve this - let me know.

Lover
#2 12.09.2014 08:20

yes same problem for me too , you can put @ for error closed ?

Added 4 minutes later:

$file_ext = strtolower(end(explode(".", $file['name'])));

like this :D

@$file_ext = strtolower(end(explode(".", $file['name'])));

Gökhan YILDIZ
#3 12.09.2014 08:27

Check gd library. If you don't installed dg library this error is normal and contact your host provider.

Save the following code as gd.php and upload public_html. Check it yoursite.com/gd.php

<?php
var_dump(gd_info());
?>

 

3 dakikalar dakika sonra eklendi:

#39902 Lover:

yes same problem for me too , you can put @ for error closed ?

Added 4 minutes later:

$file_ext = strtolower(end(explode(".", $file['name'])));

like this :D

@$file_ext = strtolower(end(explode(".", $file['name'])));

error hiding is not good solution :)

Gökhan YILDIZ
Macik
#4 12.09.2014 08:34

Please, write these data:

  • version of  Cotonti
  • version of plugin
  • version of PHP

Добавлено 12 минуты спустя:

Ok. I had check the code. It happend due to PHP using strict standards. In this case Only variables should be passed by reference.

So you must use temporary variable. Change code as follows:

			$gd_supported = array('jpg', 'jpeg', 'png', 'gif');
			$var = explode(".", $file['name']);
			$file_ext = strtolower(array_pop($var));
			$fcheck = cot_file_check($file['tmp_name'], $file['name'], $file_ext);

 

https://github.com/macik
правильный хостинг — https://goo.gl/fjCa1F
Отредактировано: Macik (12.09.2014 08:46, 9 лет назад)
SergeySt
#5 12.09.2014 08:54
#39902 Lover:

yes same problem for me too , you can put @ for error closed ?

Added 4 minutes later:

$file_ext = strtolower(end(explode(".", $file['name'])));

like this :D

@$file_ext = strtolower(end(explode(".", $file['name'])));

Thank you, this one helped

Check gd library. If you don't installed dg library this error is normal and contact your host provider.

Save the following code as gd.php and upload public_html. Check it yoursite.com/gd.php

I checked. This is the message I got:

array(12) { ["GD Version"]=> string(26) "bundled (2.1.0 compatible)" ["FreeType Support"]=> bool(true) ["FreeType Linkage"]=> string(13) "with freetype" ["T1Lib Support"]=> bool(false) ["GIF Read Support"]=> bool(true) ["GIF Create Support"]=> bool(true) ["JPEG Support"]=> bool(true) ["PNG Support"]=> bool(true) ["WBMP Support"]=> bool(true) ["XPM Support"]=> bool(true) ["XBM Support"]=> bool(true) ["JIS-mapped Japanese Font Support"]=> bool(false) }

 

 

Macik
#6 12.09.2014 10:13

Already fixed on GitHub repo.

https://github.com/macik
правильный хостинг — https://goo.gl/fjCa1F
SergeySt
#7 12.09.2014 10:18
#39904 Macik:

Please, write these data:

  • version of  Cotonti
  • version of plugin
  • version of PHP

Добавлено 12 минуты спустя:

Ok. I had check the code. It happend due to PHP using strict standards. In this case Only variables should be passed by reference.

So you must use temporary variable. Change code as follows:

			$gd_supported = array('jpg', 'jpeg', 'png', 'gif');
			$var = explode(".", $file['name']);
			$file_ext = strtolower(array_pop($var));
			$fcheck = cot_file_check($file['tmp_name'], $file['name'], $file_ext);

 

Your code also helped. Thanks a lot.

Added 3 minutes later:

#39907 Macik:

Already fixed on GitHub repo.

Cool! Thank a lot again!