Skip to content

Commit 1f9334f

Browse files
committed
v1.4.4-b1
- Set at migration max_filesize in extension_groups for Images to 0 - Change DB query for images extension in main listener
1 parent 2dddb66 commit 1f9334f

File tree

4 files changed

+48
-5
lines changed

4 files changed

+48
-5
lines changed

imcger/imgupload/composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
"type": "phpbb-extension",
44
"description": "Using ImageMagick php librarie for resize image attachments and creating thumbnails.",
55
"homepage": "https://github.com/IMC-GER/phpBB-Image-upload-use-ImageMagick/tags",
6-
"version": "1.4.3",
7-
"time": "2024-02-20",
6+
"version": "1.4.4-b1",
7+
"time": "2024-06-18",
88
"license": "GPL-2.0-only",
99
"authors": [
1010
{

imcger/imgupload/event/main_listener.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,13 @@ public function set_template_vars()
113113
$allowed_images = [];
114114
$img_max_thumb_width = $this->config['imcger_imgupload_img_max_thumb_width'];
115115

116-
$sql = 'SELECT extension FROM ' . EXTENSIONS_TABLE . ' WHERE group_id = (SELECT group_id FROM ' . EXTENSION_GROUPS_TABLE . ' WHERE group_name = "IMAGES")';
117-
$result = $this->db->sql_query($sql);
116+
$sql_ary = 'SELECT group_id FROM ' . EXTENSION_GROUPS_TABLE . ' WHERE group_name = "IMAGES"';
117+
$result = $this->db->sql_query($sql_ary);
118+
$arry = $this->db->sql_fetchrow($result);
119+
$this->db-> sql_freeresult();
120+
121+
$sql_ary = 'SELECT extension FROM ' . EXTENSIONS_TABLE . ' WHERE group_id = ' . $arry['group_id'];
122+
$result = $this->db->sql_query($sql_ary);
118123

119124
while ($row = $this->db->sql_fetchrow($result))
120125
{

imcger/imgupload/migrations/v121.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public function effectively_installed()
1919

2020
public static function depends_on()
2121
{
22-
return ['\imcger\imgupload\migrations\v100'];
22+
return ['\imcger\imgupload\migrations\v120'];
2323
}
2424

2525
public function update_data()

imcger/imgupload/migrations/v144.php

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<?php
2+
/**
3+
* Image upload use ImageMagick
4+
* An extension for the phpBB Forum Software package.
5+
*
6+
* @copyright (c) 2022, Thorsten Ahlers
7+
* @license GNU General Public License, version 2 (GPL-2.0)
8+
*
9+
*/
10+
11+
namespace imcger\imgupload\migrations;
12+
13+
class v144 extends \phpbb\db\migration\migration
14+
{
15+
public function effectively_installed()
16+
{
17+
return version_compare($this->config['imcger_imgupload_version'], '1.4.4', '>=');
18+
}
19+
20+
public static function depends_on()
21+
{
22+
return ['\imcger\imgupload\migrations\v121'];
23+
}
24+
25+
public function update_data()
26+
{
27+
return [
28+
['config.update', ['imcger_imgupload_version', '1.4.4']],
29+
['custom', [[$this, 'reset_max_filesize']]],
30+
];
31+
}
32+
33+
public function reset_max_filesize()
34+
{
35+
$sql = 'UPDATE ' . EXTENSION_GROUPS_TABLE . ' SET max_filesize = 0 WHERE group_name = "IMAGES";';
36+
$this->db->sql_query($sql);
37+
}
38+
}

0 commit comments

Comments
 (0)