JamesHeinrich / phpThumb

phpThumb() - The PHP thumbnail generator
Other
315 stars 98 forks source link

Magic quotes is deprecated in php 7.4.2 #149

Closed sashabeep closed 4 years ago

sashabeep commented 4 years ago

Getting error caused by function call

Deprecated: Function get_magic_quotes_gpc() is deprecated in /home/.../phpThumb/phpThumb.php on line 222
**Headers already sent in file "/home/.../phpThumb/phpThumb.php" on line "222", dumping error message as text:**

phpThumb.php on line 222

if (get_magic_quotes_gpc()) {
    // deprecated: 'err', 'file', 'goto',
    $RequestVarsToStripSlashes = array('src', 'wmf', 'down');
    foreach ($RequestVarsToStripSlashes as $key) {
        if (isset($_GET[$key])) {
            if (is_string($_GET[$key])) {
                $_GET[$key] = stripslashes($_GET[$key]);
            } else {
                unset($_GET[$key]);
            }
        }
    }
}

removing or commenting this condition solves the error

JamesHeinrich commented 4 years ago

Should be fixed in https://github.com/JamesHeinrich/phpThumb/commit/180c7520d6d85aa7c528d71de33d17408e915e88

samuelhgf commented 4 years ago

@JamesHeinrich still not working

JamesHeinrich commented 4 years ago

Please explain further what you mean by "not working"? What version of PHP are you testing with? What output or error do you get?

samuelhgf commented 4 years ago

I am using 7.4.3 Getting this Function get_magic_quotes_gpc() is deprecated

sashabeep commented 4 years ago

@samuelhgf looks like you didn't updated the script

samuelhgf commented 4 years ago

I downloaded the latest version from here https://sourceforge.net/projects/phpthumb/files/phpThumb%28%29/

JamesHeinrich commented 4 years ago

The SourceForge archive hasn't been updated since 2014 (although I will push the v1.7.15 release there now). The most recent version is always available at https://github.com/JamesHeinrich/phpThumb/archive/master.zip

samuelhgf commented 4 years ago

Thank you! There is a doc about how to use phpThumb as composer package? More specific with Laravel?

samuelhgf commented 4 years ago

@JamesHeinrich

JamesHeinrich commented 4 years ago

I don't have any such documentation (nor knowledge).