Subversion Repositories oidplus

Rev

Rev 362 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 362 Rev 386
Line 200... Line 200...
200
                                        $tos = file_get_contents(__DIR__ . '/tos$'.OIDplus::getCurrentLang().'.html');
200
                                        $tos = file_get_contents(__DIR__ . '/tos$'.OIDplus::getCurrentLang().'.html');
201
                                } else {
201
                                } else {
202
                                        $tos = file_get_contents(__DIR__ . '/tos.html');
202
                                        $tos = file_get_contents(__DIR__ . '/tos.html');
203
                                }
203
                                }
204
 
204
                               
205
                                // make sure the program works even if the user provided HTML is not UTF-8
205
                                list($html, $js, $css) = extractHtmlContents($tos);
-
 
206
                                $tos = '';
206
                                $tos = iconv(mb_detect_encoding($tos, mb_detect_order(), true), 'UTF-8//IGNORE', $tos);
207
                                if (!empty($js))  $tos .= "<script>\n$js\n</script>";
207
                                $bom = pack('H*','EFBBBF');
208
                                if (!empty($css)) $tos .= "<style>\n$css\n</style>";
208
                                $tos = preg_replace("/^$bom/", '', $tos);
209
                                $tos .= $html;
209
 
210
                               
210
                                $tos = str_replace('{{ADMIN_EMAIL}}', OIDplus::config()->getValue('admin_email'), $tos);
211
                                $tos = str_replace('{{ADMIN_EMAIL}}', OIDplus::config()->getValue('admin_email'), $tos);
211
                                if ($obj) {
212
                                if ($obj) {
212
                                        $tos = str_replace('{{ROOT_OID}}', $obj->getDotNotation(), $tos);
213
                                        $tos = str_replace('{{ROOT_OID}}', $obj->getDotNotation(), $tos);
213
                                        $tos = str_replace('{{ROOT_OID_ASN1}}', $obj->getAsn1Notation(), $tos);
214
                                        $tos = str_replace('{{ROOT_OID_ASN1}}', $obj->getAsn1Notation(), $tos);