FOSSology
4.4.0
Open Source License Compliance by Open Source Software
PagedTextResult.php
1
<?php
2
/*
3
SPDX-FileCopyrightText: © 2014 Siemens AG
4
Author: Andreas Würl
5
6
SPDX-License-Identifier: GPL-2.0-only
7
*/
8
9
namespace
Fossology\Lib\View;
10
11
12
// For compatibility with older php versions
13
if
(!defined(
'ENT_SUBSTITUTE'
)) {
14
define(
'ENT_SUBSTITUTE'
, 0);
//This might give an empty string, but with the conversion to UTF-8 we might not run into this
15
}
16
17
18
class
PagedTextResult
extends
PagedResult
19
{
20
const
TARGET_CHARSET =
"UTF-8"
;
21
26
protected
function
renderContentText
($text)
27
{
28
29
if
(self::TARGET_CHARSET ==
"UTF-8"
) {
30
return
convertToUTF8
($text,
true
);
31
}
32
33
return
htmlspecialchars(mb_convert_encoding($text, self::TARGET_CHARSET), ENT_SUBSTITUTE, self::TARGET_CHARSET);
34
}
35
}
Fossology\Lib\View\PagedResult
Definition:
PagedResult.php:12
Fossology\Lib\View\PagedTextResult
Definition:
PagedTextResult.php:19
Fossology\Lib\View\PagedTextResult\renderContentText
renderContentText($text)
Definition:
PagedTextResult.php:26
convertToUTF8
if(! defined('ENT_SUBSTITUTE')) convertToUTF8($content, $toHTML=true)
Definition:
common-string.php:25
src
lib
php
View
PagedTextResult.php
Generated on Mon Nov 18 2024 07:37:13 for FOSSology by
1.9.1