【问题标题】:Add a semicolon to the Codeigniter permitted URL chars向 Codeigniter 允许的 URL 字符添加分号
【发布时间】:2013-07-22 23:41:17
【问题描述】:

我需要在 Codeigniter 允许的 URL 字符模式中添加分号 (;),代码如下:

$config['permitted_uri_chars'] = 'a-z 0-9~%.:_-';

我需要添加分号(我需要这个,因为一些分号与 URL 一起传递),但我不知道如何将它添加到模式中。

提前致谢!

【问题讨论】:

    标签: php regex codeigniter


    【解决方案1】:

    除了它的预期目的之外,你们很多人不会在 URL 中使用分号。

    Can a URL contain a semi-colon?

    这不行吗?

    $config['permitted_uri_chars'] = 'a-z 0-9~%.:_-;';
    

    【讨论】:

    • SMF 将其用于他们的 URL,例如:.../forum/index.php?action=admin;area=regcenter;sa=settings 感谢您的回复。
    【解决方案2】:

    您可以插入“;”在那个配置字符串中。

    您可以插入它的 url 编码版本“%3b”,而不是 URL 中的分号

    所以:

    http://www.example.com/some%3bthing
    

    %3b 是分号,例如 %20 是空格。

    更多信息:http://webdesign.about.com/library/bl_url_encoding_table.htm

    【讨论】:

      猜你喜欢
      • 2012-03-09
      • 2011-05-09
      • 2016-10-05
      • 2017-07-05
      • 2013-04-22
      • 1970-01-01
      • 2017-10-06
      • 2014-03-12
      • 2012-05-14
      相关资源
      最近更新 更多