Subversion Repositories php_utils

Rev

Rev 13 | Rev 24 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 13 Rev 23
Line 1... Line 1...
1
<?php
1
<?php
2
 
2
 
3
/*
3
/*
4
 * OID-Utilities for PHP
4
 * OID-Utilities for PHP
5
 * Copyright 2011-2021 Daniel Marschall, ViaThinkSoft
5
 * Copyright 2011-2022 Daniel Marschall, ViaThinkSoft
6
 * Version 2021-09-23
6
 * Version 2022-01-06
7
 *
7
 *
8
 * Licensed under the Apache License, Version 2.0 (the "License");
8
 * Licensed under the Apache License, Version 2.0 (the "License");
9
 * you may not use this file except in compliance with the License.
9
 * you may not use this file except in compliance with the License.
10
 * You may obtain a copy of the License at
10
 * You may obtain a copy of the License at
11
 *
11
 *
Line 360... Line 360...
360
                if (($leading_dot) && ($n == 0)) {
360
                if (($leading_dot) && ($n == 0)) {
361
                        if ($a != '') return false;
361
                        if ($a != '') return false;
362
                        continue;
362
                        continue;
363
                }
363
                }
364
 
364
 
365
                if (!ctype_digit($a)) return false; // does contain something other than digits
365
                if (!preg_match('@^(\\d+)$@', $a, $m)) return false; // does contain something other than digits
366
 
366
 
367
                // strike leading zeroes
367
                // strike leading zeroes
368
                $a = preg_replace("@^0+@", '', $a);
368
                $a = preg_replace("@^0+@", '', $a);
369
                if ($a == '') $a = 0;
369
                if ($a == '') $a = 0;
370
 
370