Ignore:
Timestamp:
Sep 20, 2010, 3:25:12 AM (11 years ago)
Author:
roux
Message:

premiers essais pour la carte

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpc/trunk/project/apps/frontend/modules/api/actions/actions.class.php

    r1344 r1395  
    2323  {
    2424    $date = $request->getParameter('date');
    25     $this->forward404Unless(preg_match('/(\d{4})\d{2}/', $date, $d));
     25    $this->forward404Unless(preg_match('/(\d{2,4})-?\d{2}/', $date, $d));
     26    $date = preg_replace('/-/', '', $date);
     27    $date = preg_replace('/^(\d{2})(\d{2})$/', '20\\1\\2', $date);
     28    $d[1] = preg_replace('/^(\d{2})$/', '20\\1', $d[1]);
    2629    $vg = Doctrine::getTable('VariableGlobale')->findOneByChamp('stats_month_'.$d[1]);
    2730    $top = unserialize($vg->value);
Note: See TracChangeset for help on using the changeset viewer.