42 lines
1.2 KiB
PHP
42 lines
1.2 KiB
PHP
<?php
|
|
abstract class Responder {
|
|
protected $fragments = array();
|
|
protected $ldap = null;
|
|
|
|
public function __construct() {
|
|
$this->fragments = get_fragments('./html/fragments.html');
|
|
$this->ldap = new Ldap();
|
|
}
|
|
|
|
final protected function escape_tags($tags) {
|
|
foreach($tags as $key => $tag) {
|
|
$tags[$key] = $this->escape_string(strtolower($tag));
|
|
}
|
|
return $tags;
|
|
}
|
|
|
|
final protected function unescape_tags($tags) {
|
|
foreach($tags as $key => $tag) {
|
|
$tags[$key] = $this->unescape_string(strtolower($tag));
|
|
}
|
|
return $tags;
|
|
}
|
|
|
|
final protected function escape_string($string) {
|
|
return str_replace(array("'",
|
|
'"'),
|
|
array(''',
|
|
'"'),
|
|
$string);
|
|
}
|
|
|
|
final protected function unescape_string($string) {
|
|
return str_replace(array(''',
|
|
'"'),
|
|
array("'",
|
|
'"'),
|
|
$string);
|
|
}
|
|
}
|
|
?>
|