- milestone: --> 0.9
- priority: 5 --> 6
- assigned_to: nobody --> minahito
- status: open --> closed-fixed
refer this topic first.
http://www.xugj.org/modules/QandA/index.php?topic_id=451
[code]
class XCube_StringProperty extends XCube_AbstractProperty
{
function set($value)
{
if (preg_match_all("/[\\x00-\\x1f]/", $value, $matches, PREG_PATTERN_ORDER)) {
die("Get control code :" . ord($matches[0][0]));
}
$this->mValue = $value;
}
[/code]
Should it be "DEAD"?
I think it's better "LIVE" and just removing controll characters.
[code]
class XCube_StringProperty extends XCube_AbstractProperty
{
function set($value)
{
$this->mValue = preg_replace("/[\\x00-\\x1f]/", '' , $value ) ;
}
[/code]
This code looks best match with IntProperty/FloatProperty because they use intval()/floatval(). ("LIVE" and ignoring invalid characters)
TextProperty can be written like this as well as StringProperty...
[code]
class XCube_TextProperty extends XCube_AbstractProperty
{
function set($value)
{
$this->mValue = preg_replace("/[\\x00-\\x08]|[\\x0b-\\x0c]|[\\x0e-\\x1f]/" , '' , $value ) ;
}
[/code]