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 求解 yolo算法问题
  • ¥15 虚拟机打包apk出现错误
  • ¥30 最小化遗憾贪心算法上界
  • ¥15 用visual studi code完成html页面
  • ¥15 聚类分析或者python进行数据分析
  • ¥15 三菱伺服电机按启动按钮有使能但不动作
  • ¥15 js,页面2返回页面1时定位进入的设备
  • ¥50 导入文件到网吧的电脑并且在重启之后不会被恢复
  • ¥15 (希望可以解决问题)ma和mb文件无法正常打开,打开后是空白,但是有正常内存占用,但可以在打开Maya应用程序后打开场景ma和mb格式。
  • ¥20 ML307A在使用AT命令连接EMQX平台的MQTT时被拒绝