Index: trunk/extensions/SemanticMediaWiki/includes/SMW_DV_String.php |
— | — | @@ -10,21 +10,19 @@ |
11 | 11 | */ |
12 | 12 | class SMWStringValue extends SMWDataValue { |
13 | 13 | |
14 | | - private $m_value = ''; |
15 | | - private $m_xsdvalue = ''; |
| 14 | + protected $m_value = ''; // XML-safe, HTML-safe, Wiki-compatible value representation |
16 | 15 | |
17 | 16 | protected function parseUserValue($value) { |
18 | 17 | if ($value!='') { |
19 | | - $this->m_xsdvalue = smwfXMLContentEncode($value); |
20 | | - if ( (strlen($this->m_xsdvalue) > 255) && ($this->m_typeid !== '_txt') ) { // limit size (for DB indexing) |
21 | | - $this->addError(wfMsgForContent('smw_maxstring', mb_substr($value, 0, 42) . ' <span class="smwwarning">[…]</span> ' . mb_substr($value, mb_strlen($this->m_xsdvalue) - 42))); |
| 18 | + $this->m_value = smwfXMLContentEncode($value); |
| 19 | + if ( (strlen($this->m_value) > 255) && ($this->m_typeid !== '_txt') ) { // limit size (for DB indexing) |
| 20 | + $this->addError(wfMsgForContent('smw_maxstring', mb_substr($value, 0, 42) . ' <span class="smwwarning">[…]</span> ' . mb_substr($value, mb_strlen($this->m_value) - 42))); |
22 | 21 | } |
23 | | - $this->m_value = $this->m_xsdvalue; |
24 | 22 | } else { |
25 | 23 | $this->addError(wfMsgForContent('smw_emptystring')); |
26 | 24 | } |
27 | 25 | if ($this->m_caption === false) { |
28 | | - $this->m_caption = $this->m_value; |
| 26 | + $this->m_caption = $value; |
29 | 27 | } |
30 | 28 | return true; |
31 | 29 | } |
— | — | @@ -64,7 +62,7 @@ |
65 | 63 | } |
66 | 64 | |
67 | 65 | public function getXSDValue() { |
68 | | - return $this->m_xsdvalue; |
| 66 | + return $this->m_value; |
69 | 67 | } |
70 | 68 | |
71 | 69 | public function getWikiValue(){ |
— | — | @@ -80,7 +78,7 @@ |
81 | 79 | } |
82 | 80 | |
83 | 81 | public function getHash() { |
84 | | - return $this->getLongWikiText(false) . $this->m_xsdvalue ; |
| 82 | + return $this->getLongWikiText(false) . $this->m_value; |
85 | 83 | } |
86 | 84 | |
87 | 85 | public function isNumeric() { |
— | — | @@ -102,7 +100,7 @@ |
103 | 101 | * @return the line to be exported |
104 | 102 | */ |
105 | 103 | public function exportToRDF($QName, ExportRDF $exporter) { |
106 | | - return "\t\t<$QName rdf:datatype=\"http://www.w3.org/2001/XMLSchema#string\">$this->m_xsdvalue</$QName>\n"; |
| 104 | + return "\t\t<$QName rdf:datatype=\"http://www.w3.org/2001/XMLSchema#string\">$this->m_value</$QName>\n"; |
107 | 105 | } |
108 | 106 | |
109 | 107 | /** |