Overview
SHA1:7f9e78c6c5bbb8dd60e18083519411bdb235243a
Date: 2013-06-18 09:09:40
User: bohwaz
Comment:Correction bug champs dont la valeur est vérifié même s'ils sont vides
Timelines: family | ancestors | descendants | both | stable
Downloads: Tarball | ZIP archive
Other Links: files | file ages | folders | manifest
Tags And Properties
Context
2013-06-19
12:27
[f8af42f2cf] Merge stable vers trunk (user: bohwaz, tags: trunk)
12:26
[ecdc3722a7] Release 0.5.5 (user: bohwaz, tags: stable, 0.5.5)
2013-06-18
09:09
[7f9e78c6c5] Correction bug champs dont la valeur est vérifié même s'ils sont vides (user: bohwaz, tags: stable)
2013-06-08
09:10
[27a52cdec6] Release 0.5.4 (user: bohwaz, tags: stable, 0.5.4)
Changes

Modified include/class.membres.php from [894265f106] to [ff3b0c8181].

255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
...
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
...
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
                {
                    continue;
                }
            }

            if (isset($data[$key]))
            {
                if ($config['type'] == 'email' && !filter_var($data[$key], FILTER_VALIDATE_EMAIL))
                {
                    throw new UserException('Adresse e-mail invalide dans le champ "' . $config['title'] . '".');
                }
                elseif ($config['type'] == 'url' && !filter_var($data[$key], FILTER_VALIDATE_URL))
                {
                    throw new UserException('Adresse URL invalide dans le champ "' . $config['title'] . '".');
                }
                elseif ($config['type'] == 'tel')
                {
                    $data[$key] = utils::normalizePhoneNumber($data[$key]);
                }
................................................................................
                {
                    $data[$key] = strtoupper(substr($data[$key], 0, 2));
                }
                elseif ($config['type'] == 'checkbox')
                {
                    $data[$key] = empty($data[$key]) ? 0 : 1;
                }
                elseif ($config['type'] == 'number')
                {
                    if (empty($data[$key]))
                    {
                        $data[$key] = 0;
                    }

                    if (!is_numeric($data[$key]))
................................................................................
                    }

                    $data[$key] = $binary;
                }
            }
        }

        if (!empty($data['code_postal']))
        {
            if (!empty($data['pays']) && $data['pays'] == 'FR' && !preg_match('!^\d{5}$!', $data['code_postal']))
            {
                throw new UserException('Code postal invalide.');
            }
        }








|



|







 







|







 







|







255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
...
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
...
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
                {
                    continue;
                }
            }

            if (isset($data[$key]))
            {
                if ($config['type'] == 'email' && trim($data[$key]) != '' && !filter_var($data[$key], FILTER_VALIDATE_EMAIL))
                {
                    throw new UserException('Adresse e-mail invalide dans le champ "' . $config['title'] . '".');
                }
                elseif ($config['type'] == 'url' && trim($data[$key]) != '' && !filter_var($data[$key], FILTER_VALIDATE_URL))
                {
                    throw new UserException('Adresse URL invalide dans le champ "' . $config['title'] . '".');
                }
                elseif ($config['type'] == 'tel')
                {
                    $data[$key] = utils::normalizePhoneNumber($data[$key]);
                }
................................................................................
                {
                    $data[$key] = strtoupper(substr($data[$key], 0, 2));
                }
                elseif ($config['type'] == 'checkbox')
                {
                    $data[$key] = empty($data[$key]) ? 0 : 1;
                }
                elseif ($config['type'] == 'number' && trim($data[$key]) != '')
                {
                    if (empty($data[$key]))
                    {
                        $data[$key] = 0;
                    }

                    if (!is_numeric($data[$key]))
................................................................................
                    }

                    $data[$key] = $binary;
                }
            }
        }

        if (isset($data['code_postal']) && trim($data['code_postal']) != '')
        {
            if (!empty($data['pays']) && $data['pays'] == 'FR' && !preg_match('!^\d{5}$!', $data['code_postal']))
            {
                throw new UserException('Code postal invalide.');
            }
        }