Kolab SSO: Fixed charset encoding issues in logon form
This commit is contained in:
parent
6d66212f5d
commit
eb8a06d2ec
1 changed files with 13 additions and 5 deletions
|
@ -304,11 +304,9 @@ class kolab_sso extends rcube_plugin
|
||||||
|
|
||||||
$doc->createNode('input', null, array('name' => '_sso', 'type' => 'hidden'), $form);
|
$doc->createNode('input', null, array('name' => '_sso', 'type' => 'hidden'), $form);
|
||||||
|
|
||||||
// Save the form content back
|
// Save the form content back and append script
|
||||||
$args['content'] = preg_replace('|</?body>|', '', $doc->saveHTML($body));
|
$args['content'] = $doc->saveHTML($body)
|
||||||
|
. "<script>"
|
||||||
// Add script
|
|
||||||
$args['content'] .= "<script>"
|
|
||||||
. "function kolab_sso_submit(button) {"
|
. "function kolab_sso_submit(button) {"
|
||||||
. "\$('[name=_sso]').val(button.value);"
|
. "\$('[name=_sso]').val(button.value);"
|
||||||
. "\$('input[type=text],input[type=password]').attr('required', false);"
|
. "\$('input[type=text],input[type=password]').attr('required', false);"
|
||||||
|
@ -372,6 +370,16 @@ class kolab_sso extends rcube_plugin
|
||||||
*/
|
*/
|
||||||
class DOMDocumentHelper extends DOMDocument
|
class DOMDocumentHelper extends DOMDocument
|
||||||
{
|
{
|
||||||
|
public function loadHTML($html, $options = 0)
|
||||||
|
{
|
||||||
|
return parent::loadHTML('<html><head><meta content="text/html; charset=utf-8" http-equiv="Content-Type"></head><body>' . $html);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function saveHTML($node = null)
|
||||||
|
{
|
||||||
|
return preg_replace('|</?body>|', '', parent::saveHTML($node));
|
||||||
|
}
|
||||||
|
|
||||||
public function createNode($name, $value = null, $args = array(), $parent = null, $prepend = false)
|
public function createNode($name, $value = null, $args = array(), $parent = null, $prepend = false)
|
||||||
{
|
{
|
||||||
$node = parent::createElement($name);
|
$node = parent::createElement($name);
|
||||||
|
|
Loading…
Add table
Reference in a new issue