Uutiset:

Wondering if this will always be free?  See why free is better.

Main Menu
Advertisement:

Error saving profile changes

Aloittaja Sir Osis of Liver, helmikuu 26, 2020, 11:34:12 AP

« edellinen - seuraava »

Sir Osis of Liver

One member is having a problem saving profile changes -



/index.php?action=profile;area=forumprofile;u=6303;save
Call to undefined function dl()



Only happens in Forum Profile, only his account.  Checked mine and several other accounts, works fine.  Clean install with 5 mods installed, running with large production database.  He gets same error with different themes.

Advanced Topic Prefix Mod 4.0.3
Register At Post View 1.1
Join Reason 1.5
Default_Membergroup 2.0
Global Headers Footers 2.1a

Forum version: SMF 2.0.17
GD version: bundled (2.1.0 compatible)
Database Server: MariaDB
MySQL version: 10.3.22-MariaDB-cll-lve
PHP: 7.2.27
Server version: LiteSpeed
When in Emor, do as the Snamors.
                              - D. Lister

m4z

fileinfo extension included in php.ini?
"Faith is what you have in things that don't exist."
--Homer Simpson

Es gibt hier im Forum ein deutsches Support-Board!

Sir Osis of Liver

Will check tonight, but wouldn't think it's anything in php.ini as it's only affecting one account (so far), and nothing was changed in php config during rebuild.  Migrated to new host (mine), that shouldn't have caused a problem.

When in Emor, do as the Snamors.
                              - D. Lister

Shambles

Lainaus käyttäjältä: Sir Osis of Liver - helmikuu 26, 2020, 11:34:12 AP
One member is having a problem saving profile changes...

Is he, by any chance, trying to update his avatar by uploading a file?

If so, the fileinfo remark becomes valid and the extension requires checking to ensure it's being loaded in php.ini.

Sir Osis of Liver

No, if you load the Forum Profile page and save without doing anything, still throws the error.  What is function dl()?

Oddly, doesn't happen on clone I'm running on same host, different server.
When in Emor, do as the Snamors.
                              - D. Lister

Sir Osis of Liver

Ok, function dl() is in Subs-Package.php, it's called from Profile-Modify.php -



// Checks whether a file or data retrieved by fetch_web_data has the expected MIME type.
// Returns 1 if the detected MIME type matches the pattern, 0 if it doesn't, or 2 if we can't check.
function check_mime_type($data, $type_pattern, $is_path = false)
{
// On Windows, the Fileinfo extension may not be enabled by default.
if (!extension_loaded('fileinfo'))
{
// Maybe we can load it dynamically?
$loaded = false;
$safe = ini_get('safe_mode');
$dl_ok = ini_get('enable_dl');
if (empty($safe) && !empty($dl_ok))
$loaded = @dl(((PHP_SHLIB_SUFFIX === 'dll') ? 'php_' : '') . 'fileinfo.' . PHP_SHLIB_SUFFIX);

// Oh well. We tried.
if (!$loaded)
return 2;
}

// Just some nice, simple data to analyze.
if (empty($is_path))
$mime_type = finfo_buffer(finfo_open(FILEINFO_MIME), $data);

// A file, or maybe a URL?
else
{
// Local file.
if (file_exists($data))
$mime_type = mime_content_type($data);

// URL.
elseif (url_exists($data))
$mime_type = finfo_buffer(finfo_open(FILEINFO_MIME), fetch_web_data($data));

// Non-existent files obviously don't have the right MIME type.
else
return 0;
}

return (int) @preg_match('~' . $type_pattern . '~', $mime_type);
}



Problem is member's avatar, it's an external link and for some reason SMF doesn't like it.  If I remove avatar, fixes error.  If I try to reenter url or upload file, I get this -



The following errors occurred when trying to save your profile:
The avatar you have selected is either too large or not an avatar.



Avatars are set to resize using html.  File attached.
When in Emor, do as the Snamors.
                              - D. Lister

Looking

Sir, did you get a work around? While a fix is implemented for the next update this call to dl() is a real problem for those on shared hosting and have gone passed PHP 5.3 as it has been removed in 5.4 >

Sir Osis of Liver

Yes, it's fixed.  For reasons unknown, some needed php modules were not selected and mime type check on avatars was not working.  It affected all members.  Crocweb support reset php to default settings and we're good.
When in Emor, do as the Snamors.
                              - D. Lister

Advertisement: