免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1397 | 回复: 0
打印 上一主题 下一主题

来自Claroline论谈的安全建议,也适用于其它PHP程序 [复制链接]

论坛徽章:
54
2017金鸡报晓
日期:2017-02-08 10:39:42操作系统版块每日发帖之星
日期:2016-03-08 06:20:00操作系统版块每日发帖之星
日期:2016-03-07 06:20:00操作系统版块每日发帖之星
日期:2016-02-22 06:20:00操作系统版块每日发帖之星
日期:2016-01-29 06:20:00操作系统版块每日发帖之星
日期:2016-01-27 06:20:00操作系统版块每日发帖之星
日期:2016-01-20 06:20:00操作系统版块每日发帖之星
日期:2016-01-06 06:20:0015-16赛季CBA联赛之江苏
日期:2015-12-21 20:00:24操作系统版块每日发帖之星
日期:2015-12-21 06:20:00IT运维版块每日发帖之星
日期:2015-11-17 06:20:002015亚冠之广州恒大
日期:2015-11-12 10:58:02
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2009-02-05 15:45 |只看该作者 |倒序浏览
Here are some conventions to follow when developping a Claroline module :
1. do not use php short tags '<?', always use '<?php'
2. never use external data coming from the user directly : all input data MUST filtered and validated BEFORE using them
3. as a consequence : never use the super globals variables $_REQUEST, $_GET, $_POST or $_COOKIE directly in SQL or HTML code :
3.1.
always escape SQL variables using casting for numbers or
claro_sql_escape() for strings, the use of addslashes is DEPRECATED
since in it does not take mysql escaped chars into account, not
respecting this rule leads to potential execution of arbitrary SQL
queries !
3.2. always protect external data in display by using
htmlspecialchars() or striptags() functions or a similar mechanism, not
respecting this rule leads to potential data stealing from the user web
navigator (cookies, session identifier, identity theft...)
4.
avoid the use of the global namespace through either the global key
worg or the $GLOBALS super variable, not repsecting this rule can lead
to strange side-effect bugs
5. use the Claroline API provided by
the kernel libraries like sql.lib.php, init.lib.php, path.lib.php,
module.lib.php, icon.lib.php, file.lib.php, fileManage.lib.php... they
have been written to answer common tasks and issues in the Claroline
platform and to ensure common behaviour in all the scripts
6. avoid mixing php and html code (except in the Claroline 1.9 template system) to enhance code readability and maintenance
7. as a consequence always separate business logic from display
A more complete developer's documentation will follow as soon as possible.
Thanks for helping to make Claroline a better LMS.
Regards,
               
               
               

本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u1/38866/showart_1814338.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP