出于安全原因,代码信号escapeshellarg()已被禁用 [英] Codeigniter escapeshellarg() has been disabled for security reasons

查看:629
本文介绍了出于安全原因,代码信号escapeshellarg()已被禁用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有任何方法重写codeigniter的Upload.php库,因为我面对

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


escapeshellarg() / p>

escapeshellarg() has been disabled for security reasons

我尝试过这个线程在escapeshellarg之前放置@,但仍然不能上传我的图片,这只是忽略了警告。

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?

推荐答案

您可以自己创建 escapeshellarg 简单函数只转义给定字符串中的任何单引号,然后在其中添加单引号。

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.

您可以通过创建一个简单的 .php 文件中调用 phpinfo()。 (在生成的输出中搜索 disable_functions

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)

这篇关于出于安全原因,代码信号escapeshellarg()已被禁用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆