duanjing4623 2012-12-30 22:30
浏览 53
已采纳

出于安全原因,Codeigniter escapeshellarg()已被禁用

Is there any way to rewrite codeigniter's Upload.php library because I keep facing

escapeshellarg() has been disabled for security reasons

I've tried solution in this thread with putting @ in front of escapeshellarg but still cannont upload my images, thats just ignore the warning.

I've tried to contact the administrator of my hosting provide but for security reason they cannot enable it.

Is there I can do to trick this so i can upload images?

  • 写回答

4条回答 默认 最新

  • duanmoen784988 2012-12-30 22:53
    关注

    You can make your own escapeshellarg, it is a very simple function that only escapes any single quotes in the given string and then adds single quotes around it.

    function my_escapeshellarg($input)
    {
      $input = str_replace('\'', '\\\'', $input);
    
      return '\''.$input.'\'';
    }
    

    If your provider has however disabled other functions that Upload.php requires, you may be out of luck after all.

    You can look up what functions are disabled by creating a simple .php file with the call phpinfo() in it. (search for disable_functions in the generated output)

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(3条)

报告相同问题?

悬赏问题

  • ¥15 sqlite 附加(attach database)加密数据库时,返回26是什么原因呢?
  • ¥88 找成都本地经验丰富懂小程序开发的技术大咖
  • ¥15 如何处理复杂数据表格的除法运算
  • ¥15 如何用stc8h1k08的片子做485数据透传的功能?(关键词-串口)
  • ¥15 有兄弟姐妹会用word插图功能制作类似citespace的图片吗?
  • ¥200 uniapp长期运行卡死问题解决
  • ¥15 latex怎么处理论文引理引用参考文献
  • ¥15 请教:如何用postman调用本地虚拟机区块链接上的合约?
  • ¥15 为什么使用javacv转封装rtsp为rtmp时出现如下问题:[h264 @ 000000004faf7500]no frame?
  • ¥15 乘性高斯噪声在深度学习网络中的应用