Avatar

Seems Fixed (General)

by Milo ⌂, Sunday, November 27, 2016, 23:33 (326 days ago) @ Milo

Hi,

I found an error in my reg expression. Please update the function getAvatar in function.inc.php (or use the new file in zip)


function getAvatar($user_id) {
 $avatar_images_path = 'images/avatars/';
 $fileIterator = new FilesystemIterator($avatar_images_path);
 $regexFileFilterIterator = new RegexIterator($fileIterator, "/\D+(".preg_quote(intval($user_id), '/')."(_\d+)?\.(jpg|gif|png|jpeg)$)/i", RegexIterator::GET_MATCH);
 $regexFileFilterIterator->rewind();
 $filename = ($regexFileFilterIterator->valid() && count($regexFileFilterIterator->current()) > 1) ? $regexFileFilterIterator->current()[1] : false;
 if ($filename === false || !file_exists($avatar_images_path.$filename))
  return false;
 return array($avatar_images_path, $filename, $avatar_images_path.$filename);
} 


/Micha

--
Surveyor-Software: Geodetic Network Adjustment & Deformation-Analysis and Transformation


Complete thread:

 RSS Feed of thread

powered by my little forum