File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -95,6 +95,7 @@ tar cvf com.woltlab.wcf/files_pre_check.tar -C wcfsetup/install/files/ \
9595 <instruction type =" userOption" />
9696
9797 <instruction type =" script" >acp/update_com.woltlab.wcf_6.2_userCoverPhoto.php</instruction >
98+ <instruction type =" script" >acp/update_com.woltlab.wcf_6.2_cleanUpDsStore.php</instruction >
9899 </instructions >
99100
100101 <instructions type =" update" fromversion =" 6.2.0 RC 2" >
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace wcf \acp ;
4+
5+ use wcf \system \application \ApplicationHandler ;
6+ use wcf \system \WCF ;
7+
8+ // Purges any `.DS_Store` (or derivates) files that had been accidentially
9+ // deployed in the past. The `Installer` class was also modified to filter out
10+ // these files in the future.
11+
12+ $ sql = "SELECT *
13+ FROM wcf1_package_installation_file_log
14+ WHERE filename LIKE ? " ;
15+ $ statement = WCF ::getDB ()->prepare ($ sql );
16+ $ statement ->execute (['%.DS_Store ' ]);
17+
18+ while ($ row = $ statement ->fetchArray ()) {
19+ $ application = ApplicationHandler::getInstance ()->getApplication ($ row ['application ' ]);
20+ \assert ($ application !== null );
21+
22+ $ pathname = \WCF_DIR . $ application ->getPackage ()->packageDir . $ row ['filename ' ];
23+ if (\file_exists ($ pathname )) {
24+ \unlink ($ pathname );
25+ }
26+ }
27+
28+ $ sql = "DELETE FROM wcf1_package_installation_file_log
29+ WHERE filename LIKE ? " ;
30+ $ statement = WCF ::getDB ()->prepare ($ sql );
31+ $ statement ->execute (['%.DS_Store ' ]);
Original file line number Diff line number Diff line change @@ -150,6 +150,10 @@ protected function install()
150150 // remove trailing slash
151151 $ directories [] = FileUtil::removeTrailingSlash ($ file ['filename ' ]);
152152 } else {
153+ if (\str_ends_with ($ file ['filename ' ], '.DS_Store ' )) {
154+ continue ;
155+ }
156+
153157 $ files [$ index ] = $ file ['filename ' ];
154158 }
155159 }
You can’t perform that action at this time.
0 commit comments