forked from netcommons/NetCommons2
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathConverter_EscapeTextarea.class.php
More file actions
50 lines (47 loc) · 1.29 KB
/
Converter_EscapeTextarea.class.php
File metadata and controls
50 lines (47 loc) · 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<?php
/**
* WYSIWYGエディター出力テキストエスケープ
*
* @package NetCommons.component
* @author Noriko Arai,Ryuji Masukawa
* @copyright 2006-2007 NetCommons Project
* @license http://www.netcommons.org/license.txt NetCommons License
* @project NetCommons Project, supported by National Institute of Informatics
* @access public
*/
class Converter_EscapeTextarea extends Converter {
/**
* @var オブジェクトを保持
*
* @access private
*/
var $_db = null;
var $_container = null;
/**
* コンストラクター
*
* @access public
*/
function Converter_EscapeTextarea() {
$this->_container =& DIContainerFactory::getContainer();
$this->_db =& $this->_container->getComponent("DbObject");
}
/**
* @param string $attributes 変換する文字列
* @return string 変換後の文字列
* @access public
*/
function convert($attributes) {
include_once COMPONENT_DIR.'/escape/Text.class.php';
$escapeText = new Escape_Text();
if (is_array($attributes)) {
foreach ($attributes as $key => $value) {
$attributes[$key] = $escapeText->escapeWysiwyg($value);
}
} else {
$attributes = $escapeText->escapeWysiwyg($attributes);
}
return $attributes;
}
}
?>