diff --git a/libraries/DisplayResults.class.php b/libraries/DisplayResults.class.php index a9ad153121..cb19c8b721 100644 --- a/libraries/DisplayResults.class.php +++ b/libraries/DisplayResults.class.php @@ -2835,7 +2835,7 @@ class PMA_DisplayResults : false; // Wrap MIME-transformations. [MIME] - $default_function = '_mimeDefaultFunction'; // default_function + $default_function = 'PMA_mimeDefaultFunction'; // default_function $transformation_plugin = $default_function; $transform_options = array(); @@ -3798,7 +3798,7 @@ class PMA_DisplayResults $transform_options, $meta ) - : $this->$default_function($column, array(), $meta); + : $default_function($column, array(), $meta); if ($is_field_truncated) { $class .= ' truncated'; @@ -4878,7 +4878,7 @@ class PMA_DisplayResults $row = $GLOBALS['dbi']->fetchRow($dt_result); // initializing default arguments - $default_function = '_mimeDefaultFunction'; + $default_function = 'PMA_mimeDefaultFunction'; $transformation_plugin = $default_function; $transform_options = array(); @@ -5561,7 +5561,7 @@ class PMA_DisplayResults ); } else { - $result = $this->$default_function($result, array(), $meta); + $result = $default_function($result, array(), $meta); if (stristr($meta->type, self::BLOB_FIELD) && $_SESSION['tmpval']['display_blob'] ) { @@ -5697,7 +5697,7 @@ class PMA_DisplayResults $transform_options, $meta ) - : $this->$default_function($data) + : $default_function($data) ) . ' [->' . $dispval . ']'; @@ -5750,10 +5750,10 @@ class PMA_DisplayResults if ($relational_display == self::RELATIONAL_DISPLAY_COLUMN) { // user chose "relational display field" in the // display options, so show display field in the cell - $result .= $this->$default_function($dispval); + $result .= $default_function($dispval); } else { // otherwise display data in the cell - $result .= $this->$default_function($data); + $result .= $default_function($data); } } @@ -5767,7 +5767,7 @@ class PMA_DisplayResults $transform_options, $meta ) - : $this->$default_function($data) + : $default_function($data) ); } @@ -6060,32 +6060,6 @@ class PMA_DisplayResults } // end of the '_getCheckboxAndLinks()' function - - /** - * Replace some html-unfriendly stuff - * - * @param string $buffer String to process - * - * @return String Escaped and cleaned up text suitable for html. - * - * @access private - * - * @see _getDataCellForBlobField(), _getRowData(), - * _handleNonPrintableContents() - */ - private function _mimeDefaultFunction($buffer) - { - $buffer = htmlspecialchars($buffer); - $buffer = str_replace( - "\011", - '    ', - str_replace(' ', '  ', $buffer) - ); - $buffer = preg_replace("@((\015\012)|(\015)|(\012))@", '
', $buffer); - - return $buffer; - } - /** * Display binary columns as hex string if requested * otherwise escape the contents using the best possible way diff --git a/test/classes/PMA_DisplayResults_test.php b/test/classes/PMA_DisplayResults_test.php index 862067bfb0..c4d60335d5 100644 --- a/test/classes/PMA_DisplayResults_test.php +++ b/test/classes/PMA_DisplayResults_test.php @@ -1294,22 +1294,6 @@ class PMA_DisplayResults_Test extends PHPUnit_Framework_TestCase ); } - /** - * Test for _mimeDefaultFunction - * - * @return void - */ - public function testMimeDefaultFunction() - { - $this->assertEquals( - "A 'quote' is <b>bold</b>", - $this->_callPrivateFunction( - '_mimeDefaultFunction', - array("A 'quote' is bold") - ) - ); - } - /** * Data provider for testGetPlacedLinks *