Index: branches/img_metadata/phase3/includes/media/XMPValidate.php |
— | — | @@ -222,6 +222,17 @@ |
223 | 223 | * many parts are optional, some aren't. For example if you specify |
224 | 224 | * minute, you must specify hour, day, month, and year but not second or TZ. |
225 | 225 | */ |
| 226 | + |
| 227 | + /* |
| 228 | + * First of all, if year = 0000, Something is wrongish, |
| 229 | + * so don't extract. This seems to happen when |
| 230 | + * some programs convert between metadata formats. |
| 231 | + */ |
| 232 | + if ( $res[1] === '0000' ) { |
| 233 | + wfDebugLog( 'XMP', __METHOD__ . " Invalid date (year 0): $val" ); |
| 234 | + $val = null; |
| 235 | + return; |
| 236 | + } |
226 | 237 | //if month, etc unspecified, full out as 01. |
227 | 238 | $res[2] = isset( $res[2] ) ? $res[2] : '01'; //month |
228 | 239 | $res[3] = isset( $res[3] ) ? $res[3] : '01'; //day |