Autre essai

This commit is contained in:
Michael RICOIS 2012-02-20 15:04:29 +00:00
parent 17aa8ff360
commit 6d7563a694

View File

@ -1404,7 +1404,7 @@ class PiecesController extends Zend_Controller_Action
if ( !empty($siren) || intval($siren)==0 ){
foreach (glob("$path/$siren_*.pdf") as $filename) {
preg_match('/([0-9]{9})_(.*)/', $filename, $matches); print_r($matches);
preg_match('/^([0-9]{9})_(.*)\.pdf$/', $filename, $matches); print_r($matches);
$date = $matches[2];
if ( $user->checkPerm('actes') ) {
$href = $this->view->url(array(
@ -1419,7 +1419,7 @@ class PiecesController extends Zend_Controller_Action
}
$suffix = '-0';
if ( preg_match('/^[0-9]{9}_[0-9]{8}_rectif([0-9]?)\.pdf/', $filename, $mSuffix) ) {
if ( preg_match('/^[0-9]{9}_[0-9]{8}_rectif([0-9]?)\.pdf$/', $filename, $mSuffix) ) {
$suffix = '-1';
if ( intval($mSuffix[1])!=0 ) {
$suffix = '-'.$mSuffix[1];