Procházet zdrojové kódy

Merge two conditions

jvoisin před 1 rokem
rodič
revize
2314500515
1 změnil soubory, kde provedl 1 přidání a 5 odebrání
  1. 1 5
      internal/reader/sanitizer/sanitizer.go

+ 1 - 5
internal/reader/sanitizer/sanitizer.go

@@ -181,11 +181,7 @@ func sanitizeAttributes(baseURL, tagName string, attributes []html.Attribute) ([
 		}
 		}
 
 
 		if tagName == "img" && (attribute.Key == "width" || attribute.Key == "height") {
 		if tagName == "img" && (attribute.Key == "width" || attribute.Key == "height") {
-			if !isPositiveInteger(value) {
-				continue
-			}
-
-			if isImageLargerThanLayout {
+			if isImageLargerThanLayout || !isPositiveInteger(value) {
 				continue
 				continue
 			}
 			}
 		}
 		}