File tree Expand file tree Collapse file tree 5 files changed +39
-3
lines changed
Expand file tree Collapse file tree 5 files changed +39
-3
lines changed Original file line number Diff line number Diff line change 1+ 1.4.3 (2021-04-28)
2+ - Fix allowlist name in SQL (un)install script + update to fix situation for everyone
3+
141.4.2 (2021-04-20)
25 - Joomla 4 Compatibility
36 - Language: Whitelist -> Allow list (en/de)
Original file line number Diff line number Diff line change 99 <homepage >https://github.com/codeling/bfstop</homepage >
1010 <authorEmail >bfstop@bfroehler.info</authorEmail >
1111 <authorUrl >https://github.com/codeling/bfstop</authorUrl >
12- <version >1.4.2 </version >
12+ <version >1.4.3 </version >
1313 <files >
1414 <filename plugin =" bfstop" >bfstop.php</filename >
1515 <filename >index.html</filename >
220220 </fieldset >
221221 </fields >
222222 </config >
223+ <scriptfile >updatescript.php</scriptfile >
223224</extension >
Original file line number Diff line number Diff line change @@ -10,12 +10,12 @@ dstdir=
1010# internal variables to be updated when files are added:
1111extname=bfstop
1212sqlfiles=" sql"
13- srcfiles=" $extname .php helpers $extname .xml $sqlfiles setupscripts .php index.html"
13+ srcfiles=" $extname .php helpers $extname .xml $sqlfiles updatescript .php index.html"
1414langfiles=" language"
1515docs=" CHANGELOG LICENSE.txt README"
1616plgtype=" system"
1717langs=" de-DE en-GB"
18- version=1.4.2
18+ version=1.4.3
1919
2020if [ " $1 " == " zip" ]
2121then
Original file line number Diff line number Diff line change 1+ -- Update DB schema to version 1.4.3
Original file line number Diff line number Diff line change 1+ <?php
2+ defined ('_JEXEC ' ) or die;
3+
4+ class PlgsystembfstopInstallerScript
5+ {
6+ function install ($ parent ) {}
7+ function uninstall ($ parent ) {}
8+ function preflight ($ type , $ parent ) {}
9+ function postflight ($ type , $ parent ) {}
10+
11+ function update ($ parent )
12+ {
13+ // for version 1.4.2, whitelist was renamed to allowlist, but only for updates;
14+ // for new installs, the old name remained, so let's fix this for all installations:
15+ $ db = JFactory::getDbo ();
16+ try
17+ {
18+ $ sql = "SELECT COUNT(*) FROM `#__bfstop_whitelist` " ;
19+ $ db ->setQuery ($ sql );
20+ $ numEntries = ((int )$ db ->loadResult ());
21+ $ sql = "RENAME TABLE `#__bfstop_whitelist` TO `#__bfstop_allowlist` " ;
22+ $ db ->setQuery ($ sql );
23+ $ db ->execute ();
24+ }
25+ catch (Exception $ e )
26+ {
27+ // if table doesn't exist, there's nothing we need to do
28+ // Log::add("Update ERROR: ".$e->getMessage(), Log::ERROR, 'Update');
29+ }
30+ }
31+ }
You can’t perform that action at this time.
0 commit comments