| @@ 649-665 (lines=17) @@ | ||
| 646 | $GLOBALS['_xh']['value']=false; |
|
| 647 | } |
|
| 648 | } |
|
| 649 | elseif ($name=='DOUBLE') |
|
| 650 | { |
|
| 651 | // we have a DOUBLE |
|
| 652 | // we must check that only 0123456789-.<space> are characters here |
|
| 653 | // NOTE: regexp could be much stricter than this... |
|
| 654 | if (!preg_match('/^[+-eE0123456789 \t.]+$/', $GLOBALS['_xh']['ac'])) |
|
| 655 | { |
|
| 656 | /// @todo: find a better way of throwing an error than this! |
|
| 657 | error_log('XML-RPC: non numeric value received in DOUBLE: '.$GLOBALS['_xh']['ac']); |
|
| 658 | $GLOBALS['_xh']['value']='ERROR_NON_NUMERIC_FOUND'; |
|
| 659 | } |
|
| 660 | else |
|
| 661 | { |
|
| 662 | // it's ok, add it on |
|
| 663 | $GLOBALS['_xh']['value']=(double)$GLOBALS['_xh']['ac']; |
|
| 664 | } |
|
| 665 | } |
|
| 666 | else |
|
| 667 | { |
|
| 668 | // we have an I4/INT |
|
| @@ 666-681 (lines=16) @@ | ||
| 663 | $GLOBALS['_xh']['value']=(double)$GLOBALS['_xh']['ac']; |
|
| 664 | } |
|
| 665 | } |
|
| 666 | else |
|
| 667 | { |
|
| 668 | // we have an I4/INT |
|
| 669 | // we must check that only 0123456789-<space> are characters here |
|
| 670 | if (!preg_match('/^[+-]?[0123456789 \t]+$/', $GLOBALS['_xh']['ac'])) |
|
| 671 | { |
|
| 672 | /// @todo find a better way of throwing an error than this! |
|
| 673 | error_log('XML-RPC: non numeric value received in INT: '.$GLOBALS['_xh']['ac']); |
|
| 674 | $GLOBALS['_xh']['value']='ERROR_NON_NUMERIC_FOUND'; |
|
| 675 | } |
|
| 676 | else |
|
| 677 | { |
|
| 678 | // it's ok, add it on |
|
| 679 | $GLOBALS['_xh']['value']=(int)$GLOBALS['_xh']['ac']; |
|
| 680 | } |
|
| 681 | } |
|
| 682 | //$GLOBALS['_xh']['ac']=''; // is this necessary? |
|
| 683 | $GLOBALS['_xh']['lv']=3; // indicate we've found a value |
|
| 684 | break; |
|