public $_trailing_context_lines = 10000;
/**
- * {@internal Missing Description}}
+ * Threshold for when a diff should be saved or omitted.
*
* @var float
* @access protected
*/
protected $_show_split_view = true;
+ protected $compat_fields = array( '_show_split_view', 'inline_diff_renderer', '_diff_threshold' );
+
/**
* Constructor - Call parent constructor with params array.
*
$diff = $renderer->render( $text_diff );
// If they're too different, don't include any <ins> or <dels>
- if ( $diff_count = preg_match_all( '!(<ins>.*?</ins>|<del>.*?</del>)!', $diff, $diff_matches ) ) {
+ if ( preg_match_all( '!(<ins>.*?</ins>|<del>.*?</del>)!', $diff, $diff_matches ) ) {
// length of all text between <ins> or <del>
$stripped_matches = strlen(strip_tags( join(' ', $diff_matches[0]) ));
// since we count lengith of text between <ins> or <del> (instead of picking just one),
* @return mixed Property.
*/
public function __get( $name ) {
- return $this->$name;
+ if ( in_array( $name, $this->compat_fields ) ) {
+ return $this->$name;
+ }
}
/**
* @return mixed Newly-set property.
*/
public function __set( $name, $value ) {
- return $this->$name = $value;
+ if ( in_array( $name, $this->compat_fields ) ) {
+ return $this->$name = $value;
+ }
}
/**
* @return bool Whether the property is set.
*/
public function __isset( $name ) {
- return isset( $this->$name );
+ if ( in_array( $name, $this->compat_fields ) ) {
+ return isset( $this->$name );
+ }
}
/**
* @param string $name Property to unset.
*/
public function __unset( $name ) {
- unset( $this->$name );
- }
-
- /**
- * Make private/protected methods readable for backwards compatibility.
- *
- * @since 4.0.0
- * @access public
- *
- * @param callable $name Method to call.
- * @param array $arguments Arguments to pass when calling.
- * @return mixed|bool Return value of the callback, false otherwise.
- */
- public function __call( $name, $arguments ) {
- return call_user_func_array( array( $this, $name ), $arguments );
+ if ( in_array( $name, $this->compat_fields ) ) {
+ unset( $this->$name );
+ }
}
}