douqiang4501 2011-09-16 19:52
浏览 39
已采纳

CKEditor“和\”魔术引用问题

I have a problem with CKEditor. When I try to add a link with it

<a href="foo.html">foo</a>

it always replaces " with \"

<a href=\"foo.html\">foo</a>

This kind of notation seems like working when I print it on a page but if I e-mail it with a php script, gmail renders it like

<a>foo</a>

Can anyone have an idea about that?

Can I achieve this with config.js?

Note: This is not about the mailer php script because I have tested it without CKEditor.

UPDATE: I have disabled the magic quotes in my php script and working properly.

  • 写回答

1条回答 默认 最新

  • dongwaner1367 2012-06-01 11:30
    关注

    to avoid disabling magic_quotes for example for a shared server i have used (caus i had a problem in mailto link converted to \ )

    stripslashes($text)

    or as i have found in php.net manual example #2

    if (get_magic_quotes_gpc()) {
        $process = array(&$_GET, &$_POST, &$_COOKIE, &$_REQUEST);
        while (list($key, $val) = each($process)) {
            foreach ($val as $k => $v) {
                unset($process[$key][$k]);
                if (is_array($v)) {
                    $process[$key][stripslashes($k)] = $v;
                    $process[] = &$process[$key][stripslashes($k)];
                } else {
                    $process[$key][stripslashes($k)] = stripslashes($v);
                }
            }
        }
        unset($process);
    }
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 stata安慰剂检验作图但是真实值不出现在图上
  • ¥15 c程序不知道为什么得不到结果
  • ¥40 复杂的限制性的商函数处理
  • ¥15 程序不包含适用于入口点的静态Main方法
  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题