File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 8383 if ( ! url ) {
8484 return false ;
8585 }
86- const u = url . toLowerCase ( ) ;
87- return ! u . includes ( 'example.pl' ) && ! u . includes ( 'example.com' ) ;
86+ try {
87+ const u = new URL ( url ) ;
88+ if ( u . protocol !== 'http:' && u . protocol !== 'https:' ) {
89+ return false ;
90+ }
91+ const host = u . hostname . toLowerCase ( ) ;
92+ return host !== 'example.pl' && host !== 'example.com' && ! host . endsWith ( '.example.pl' ) && ! host . endsWith ( '.example.com' ) ;
93+ } catch {
94+ return false ;
95+ }
8896 }
8997 restartAnimation ( el ) {
9098 el . classList . remove ( 'animate' ) ;
194202 const img = document . createElement ( 'img' ) ;
195203 img . src = brand . logotype_url ;
196204 img . alt = brand . name || '' ;
197- img . addEventListener ( 'error' , ( ) => {
198- tile . remove ( ) ;
199- if ( grid . childElementCount === 0 ) {
200- section . hidden = true ;
201- }
202- } ) ;
205+ img . addEventListener ( 'error' , ( ) => {
206+
207+ tile . remove ( ) ;
208+
209+ if ( grid . childElementCount === 0 ) {
210+
211+ section . hidden = true ;
212+
213+ }
214+
215+ } ) ;
216+
203217 if ( this . isRealUrl ( brand . website_url ) ) {
204218 const a = document . createElement ( 'a' ) ;
205219 a . href = brand . website_url ;
You can’t perform that action at this time.
0 commit comments