X-Git-Url: https://git.llucax.com/software/sercom-old.git/blobdiff_plain/ac7a3a999286bddd9ab83754fc0e25df0a926493..0b7153a0b2a86f6ff71256b4eac7434d6c5bf1bd:/src/sc_fetch diff --git a/src/sc_fetch b/src/sc_fetch index 6a78b6d..aea08d4 100755 --- a/src/sc_fetch +++ b/src/sc_fetch @@ -186,7 +186,7 @@ EOT; function validar_cabecera($hdr) { // Subject: padron nro_ej nro_entrega clave_alumno $subject = decode_header($hdr->subject); - if (preg_match('/^\s*(\d{5})\s+([1-4])\.([12])\s+(.*)$/', $subject, $m)) { + if (preg_match('/^\s*(\d{5})\s+(\d)\.(\d)\s+(.*)$/', $subject, $m)) { return array_slice($m, 1, 5); } return false; @@ -202,7 +202,8 @@ function preparar_entrega($intento, $mbox, $msgid, $dir) { if ($fname) { logs("Escribiendo archivo '$fname' [enc={$part->encoding}]", DEBUG); $body = decode_body(imap_fetchbody($mbox, $msgid, $id + 1), $part->encoding); - if (!file_put_contents("$path/$fname", $body) and $body) return "Error al guardar el archivo $fname"; + if (!$body) return "El archivo '$fname' está vacío"; + if (!file_put_contents("$path/$fname", $body)) return "Error al guardar el archivo $fname"; } //if (part_is_source($part) $has_sources = true; //elseif (part_mime_type($part) == 'application/zip') $has_sources = true;