Kirk
Well-known member
Hey all so recently I got some bugs reported on one of my add-ons
So here are some of the errors some of the users have been reporting to me
And here's my DataWriter code:
So here are some of the errors some of the users have been reporting to me
Fatal error: Maximum execution time of 30 seconds exceeded in C:\xampp\htdocs\forum\library\XenForo\Image\Gd.php on line 78
Fatal error: Maximum execution time of 190 seconds exceeded in C:\xampp\htdocs\forum\library\XenForo\Image\Gd.php on line 78
ErrorException: Fatal Error: Maximum execution time of 120 seconds exceeded - library/XenForo/Image/Gd.php:186
Generated By: Unknown Account, Today at 5:43 PM
Stack Trace
#0 [internal function]: XenForo_Application::handleFatalError()
#1 {main}
Request State
array(3) {
["url"] => string(58) "xxx.net"
["_GET"] => array(1) {
["register/register"] => string(0) ""
}
["_POST"] => array(16) {
["username"] => string(0) ""
["c9b27263b9a83d84101f7a221377022d"] => string(12) "xxx"
["avatar_upload"] => string(1) "0"
["340212248c47f964cde9e0393704fc8a"] => string(0) ""
["96cf24fadb584241b76e6b838e8dc20b"] => string(21) "xxx@gmail.com"
["password"] => string(8) "********"
["fc5796452a9baf6c479bc5b4c9fb9fb5"] => string(6) "female"
["dob_month"] => string(2) "12"
["dob_day"] => string(2) "23"
["dob_year"] => string(4) "1989"
["location"] => string(14) "hetton le hole"
["7d25ef349dbb075e80865050802b0836"] => string(13) "Europe/London"
["g-recaptcha-response"] => string(420) ["agree"] => string(1) "1"
["_xfToken"] => string(8) "********"
}
}
And here's my DataWriter code:
PHP:
class GFNRegAvatar_Extend_XenForo_DataWriter_User extends XFCP_GFNRegAvatar_Extend_XenForo_DataWriter_User
{
protected $_avatarFile = false;
protected function _preSave()
{
parent::_preSave();
if (!XenForo_Application::isRegistered('regAvatarProxy'))
{
return;
}
$avatar = XenForo_Application::get('regAvatarProxy');
if (empty($avatar['file']))
{
if ($avatar['required'] && $avatar['supported'])
{
$this->error(new XenForo_Phrase('gfnregavatar_please_select_valid_avatar'), 'avatar');
}
return;
}
/** @var XenForo_Upload $file */
$file = $avatar['file'];
if (!$file->isValid())
{
foreach ($file->getErrors() as $error)
{
$this->error($error, 'avatar');
}
}
if (!$file->isImage())
{
$this->error(new XenForo_Phrase('uploaded_file_is_not_valid_image'), 'avatar');
}
$imageType = $file->getImageInfoField('type');
if (!in_array($imageType, array(IMAGETYPE_GIF, IMAGETYPE_JPEG, IMAGETYPE_PNG)))
{
$this->error(new XenForo_Phrase('uploaded_file_is_not_valid_image'), 'avatar');
}
$this->_avatarFile = $file->getTempFile();
}
protected function _postSaveAfterTransaction()
{
parent::_postSaveAfterTransaction();
if ($this->_avatarFile)
{
/** @var XenForo_Model_Avatar $avatarModel */
$avatarModel = $this->getModelFromCache('XenForo_Model_Avatar');
try
{
$avatarModel->applyAvatar($this->get('user_id'), $this->_avatarFile);
}
catch (Exception $e)
{
XenForo_Error::logException($e);
}
}
}
}