小编Mr.*_*h67的帖子

CodeIgniter表单上的XSS过滤

我目前正在学习框架"CodeIgniter".但我的表单验证有问题.首先,让我告诉你我的观点:

<form method="post" action="connexion">
  <label for="pseudo">Pseudo : </label>
  <input type="text" name="pseudo" value="" />

  <label for="mdp">Mot de passe :</label>
  <input type="password" name="mdp" value="" />

  <input type="submit" value="Envoyer" /></form>
Run Code Online (Sandbox Code Playgroud)

我的控制器:

public function connexion()
{
    $this->load->library('form_validation');

    $this->form_validation->set_rules('pseudo', '"user name"', 'trim|required|min_length[5]|max_length[52]|alpha_dash|encode_php_tags|xss_clean');
    $this->form_validation->set_rules('mdp',    '"password"',       'trim|required|min_length[5]|max_length[52]|alpha_dash|encode_php_tags|xss_clean');

    if($this->form_validation->run())
    {
        $this->load->view('connexion_ok');
    }
    else
    {
        $this->load->view('form');
    }
}
Run Code Online (Sandbox Code Playgroud)

当我在set_rules()中删除控制器中的"xss_clean"过滤器时,它运行正常,表单有效.如果存在"xss_clean",则它不起作用,它在其他地方.我在输入中不使用特殊字符,只使用字母.

在设置中我把它设为true:$ config ['global_xss_filtering'] = TRUE;

我读到某处"xss_clean"过滤器没用.我还能用什么?也许帮助者或其他什么?谢谢

php model-view-controller controller codeigniter view

3
推荐指数
2
解决办法
9927
查看次数

如何定位"g"元素SVG

我有一个SVG元素,它是一个圆圈的箭头:https://jsfiddle.net/seabon/806ew03a/

<svg version="1.1" id="layer" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"                          viewBox="15 15 102 102" style="enable-background:new 0 0 132 132;" xml:space="preserve" data-link="go_down">
            <g class="cross-circle">
                <g class="go-clockwise">
                    <circle class="st0" cx="66" cy="66" r="43.7"/>
                </g>
            </g>
            <g class="down">
                <polyline class="st1" points="76.4,71 66,81.4 55.6,71 "/>
                <line class="st1" x1="66" y1="81" x2="66" y2="47"/>
            </g>
</svg>
Run Code Online (Sandbox Code Playgroud)

我想用css翻译箭头位置.我尝试在g元素上使用"相对"类的位置相对但它不起作用.我试图放一个foreignObject但是也不行.有人有想法吗?

css svg position

2
推荐指数
1
解决办法
2707
查看次数