authorize all files in 9gag (test)
This commit is contained in:
@@ -735,7 +735,10 @@ class Databap extends PhpObject
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$asResult = $this->downloadToTmp($o9gagImage->getAttribute('src'));
|
|
||||||
|
$sUrl = $o9gagImage->getAttribute('src');
|
||||||
|
$sFilePath = self::DOC_TMP_FOLDER.uniqid();
|
||||||
|
$asResult = ToolBox::createThumbnail($sUrl, self::CHAT_IMG_MAX_WIDTH, self::CHAT_IMG_MAX_HEIGHT, $sFilePath, false, array());
|
||||||
|
|
||||||
if($asResult['error']=='')
|
if($asResult['error']=='')
|
||||||
{
|
{
|
||||||
@@ -1957,7 +1960,7 @@ class Databap extends PhpObject
|
|||||||
$sFrom = $asUserFrom['name'].' <www-data@lutran.fr>';
|
$sFrom = $asUserFrom['name'].' <www-data@lutran.fr>';
|
||||||
|
|
||||||
$sTo = $asUserTo['name'].' <'.$asUserTo['email'].'>';
|
$sTo = $asUserTo['name'].' <'.$asUserTo['email'].'>';
|
||||||
$sMessage .= "\n\n\n".'<i>Ne répondez pas à ce mail. Connectez-vous sur <a href="http://databap.lutran.fr/chat">Databap</a>.</i>';
|
$sMessage .= "\n\n\n".'<i>Ne répondez pas à ce mail. Connectez-vous sur <a href="http://databap.lutran.fr/#chat">Databap</a>.</i>';
|
||||||
|
|
||||||
$sResult = ToolBox::sendMail($sFrom, 'Databap PM', $sMessage, $sTo, array(), false);
|
$sResult = ToolBox::sendMail($sFrom, 'Databap PM', $sMessage, $sTo, array(), false);
|
||||||
$bSuccess = ($sResult==ToolBox::MAIL_SUCCESS);
|
$bSuccess = ($sResult==ToolBox::MAIL_SUCCESS);
|
||||||
|
|||||||
@@ -177,7 +177,7 @@ class ToolBox
|
|||||||
elseif(!array_key_exists('extension', $asOutInfo)) $sOutPath .= '.'.$sImageExt; //folder + filename, but getting ext from file info
|
elseif(!array_key_exists('extension', $asOutInfo)) $sOutPath .= '.'.$sImageExt; //folder + filename, but getting ext from file info
|
||||||
|
|
||||||
//New sizes
|
//New sizes
|
||||||
if(!in_array($sImageExt, $asImageExts)) $asResult['error'] = 'Wrong file type: '.$sImageExt;
|
if(!in_array($sImageExt, $asImageExts) && !empty($asImageExts)) $asResult['error'] = 'Wrong file type: '.$sImageExt;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
list($iWidth, $iHeight) = getimagesize($sInPath);
|
list($iWidth, $iHeight) = getimagesize($sInPath);
|
||||||
|
|||||||
Reference in New Issue
Block a user