Index: trunk/extensions/SemanticMediaWiki/includes/datavalues/SMW_DataValue.php |
— | — | @@ -160,18 +160,16 @@ |
161 | 161 | $this->mHasServiceLinks = false; |
162 | 162 | $this->m_caption = is_string( $caption ) ? trim( $caption ) : false; |
163 | 163 | |
| 164 | + |
| 165 | + $this->parseUserValue( $value ); // may set caption if not set yet, depending on datavalue |
| 166 | + |
164 | 167 | // The following checks for markers generated by MediaWiki to handle special content, |
165 | 168 | // e.g. math. In general, we are not prepared to handle such content properly, and we |
166 | 169 | // also have no means of obtaining the user input at this point. Hence the assignement |
167 | | - // just fails. |
| 170 | + // just fails, even if parseUserValue() above might not have noticed this issue. |
168 | 171 | // Note: \x07 was used in MediaWiki 1.11.0, \x7f is used now (backwards compatiblity, b/c) |
169 | | - if ( ( strpos( $value, "\x7f" ) === false ) && ( strpos( $value, "\x07" ) === false ) ) { |
170 | | - $this->parseUserValue( $value ); // may set caption if not set yet, depending on datavalue |
171 | | - } else { |
| 172 | + if ( ( strpos( $value, "\x7f" ) !== false ) || ( strpos( $value, "\x07" ) !== false ) ) { |
172 | 173 | $this->addError( wfMsgForContent( 'smw_parseerror' ) ); |
173 | | - if ( $this->m_caption === false ) { |
174 | | - $this->m_caption = $value; // ensure that at least input can be shown |
175 | | - } |
176 | 174 | } |
177 | 175 | |
178 | 176 | if ( $this->isValid() ) { |