- my ($w, $h) = ($params{size} =~ /^(\d+)x(\d+)$/);
- return "[[img ".sprintf(gettext('bad size "%s"'), $params{size})."]]"
- unless (defined $w && defined $h);
+ my ($w, $h) = ($params{size} =~ /^(\d*)x(\d*)$/);
+ error sprintf(gettext('bad size "%s"'), $params{size})
+ unless (defined $w && defined $h &&
+ (length $w || length $h));