mirror of
https://github.com/torrentpier/torrentpier
synced 2025-07-06 04:51:43 -07:00
misc: Some minor improvements (#1829)
This commit is contained in:
parent
380c94ff07
commit
3b8ee4c4d3
4 changed files with 9 additions and 8 deletions
2
ajax.php
2
ajax.php
|
@ -41,5 +41,5 @@ $ajax->exec();
|
|||
/**
|
||||
* @deprecated ajax_common
|
||||
* Dirty class removed from here since 2.2.0
|
||||
* To add new actions see at src/Legacy/Ajax.php
|
||||
* To add new actions see at src/Ajax.php
|
||||
*/
|
||||
|
|
|
@ -67,7 +67,7 @@ class Attach
|
|||
$this->attachment_extension_list = get_var('extension_list', ['']);
|
||||
$this->attachment_mimetype_list = get_var('mimetype_list', ['']);
|
||||
|
||||
$this->filename = (isset($_FILES['fileupload'], $_FILES['fileupload']['name']) && $_FILES['fileupload']['name'] !== 'none') ? trim(stripslashes($_FILES['fileupload']['name'])) : '';
|
||||
$this->filename = (isset($_FILES['fileupload']['name']) && $_FILES['fileupload']['name'] !== 'none') ? trim(stripslashes($_FILES['fileupload']['name'])) : '';
|
||||
|
||||
$this->attachment_list = get_var('attachment_list', ['']);
|
||||
$this->attachment_thumbnail_list = get_var('attach_thumbnail_list', [0]);
|
||||
|
@ -431,7 +431,7 @@ class Attach
|
|||
}
|
||||
}
|
||||
|
||||
// Get current informations to delete the Old Attachment
|
||||
// Get current information to delete the Old Attachment
|
||||
$sql = 'SELECT physical_filename, comment, thumbnail
|
||||
FROM ' . BB_ATTACHMENTS_DESC . '
|
||||
WHERE attach_id = ' . (int)$attachment_id;
|
||||
|
|
|
@ -9,8 +9,6 @@
|
|||
|
||||
namespace TorrentPier\Legacy;
|
||||
|
||||
use function in_array;
|
||||
|
||||
/**
|
||||
* Class BBCode
|
||||
* @package TorrentPier\Legacy
|
||||
|
@ -388,7 +386,7 @@ class BBCode
|
|||
{
|
||||
global $bb_cfg;
|
||||
|
||||
if (in_array(parse_url($href, PHP_URL_HOST), $bb_cfg['nofollow']['allowed_url']) || $bb_cfg['nofollow']['disabled']) {
|
||||
if (\in_array(parse_url($href, PHP_URL_HOST), $bb_cfg['nofollow']['allowed_url']) || $bb_cfg['nofollow']['disabled']) {
|
||||
$link = "<a href=\"$href\" class=\"postLink\">$name</a>";
|
||||
} else {
|
||||
$link = "<a href=\"$href\" class=\"postLink\" rel=\"nofollow\">$name</a>";
|
||||
|
|
|
@ -9,6 +9,9 @@
|
|||
|
||||
namespace TorrentPier\Legacy\Common;
|
||||
|
||||
use claviska\SimpleImage;
|
||||
use Exception;
|
||||
|
||||
/**
|
||||
* Class Upload
|
||||
* @package TorrentPier\Legacy\Common
|
||||
|
@ -165,14 +168,14 @@ class Upload
|
|||
if (($this->cfg['max_width'] && $width > $this->cfg['max_width']) || ($this->cfg['max_height'] && $height > $this->cfg['max_height'])) {
|
||||
for ($i = 0, $max_try = 3; $i <= $max_try; $i++) {
|
||||
try {
|
||||
$image = new \claviska\SimpleImage();
|
||||
$image = new SimpleImage();
|
||||
$image
|
||||
->fromFile($this->file['tmp_name'])
|
||||
->autoOrient()
|
||||
->resize($this->cfg['max_width'], $this->cfg['max_height'])
|
||||
->toFile($this->file['tmp_name']);
|
||||
break;
|
||||
} catch (\Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
if ($i == $max_try) {
|
||||
$this->errors[] = sprintf($lang['UPLOAD_ERROR_DIMENSIONS'], $this->cfg['max_width'], $this->cfg['max_height']);
|
||||
return false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue