官术网_书友最值得收藏!

How a filter works

Before trying to build a filter, it would help to understand how it works. To begin with, any text written to the screen in Moodle should be processed through the format_text function. The purpose of this function is to process the text, such that it is always safe to be displayed. This means making sure there are no security issues and that any HTML used contains only allowed tags.

Additionally, the output is run through the filter_text function, and this is the function we are interested in. This function takes the text destined for the screen, and applies all enabled filters to it. The resulting text will be the result of all of these filters.

filter_text applies each enabled filter to the text in the order defined in the filter configuration screen (shown in the following screenshot). The order is important; each filter will be fed the output of the previous filter's text. So it is always possible that one filter may change the text in a way that impacts the next filter.

How a filter works
主站蜘蛛池模板: 鄂州市| 南江县| 阳春市| 东乌| 仪征市| 滨州市| 井冈山市| 衡阳市| 阆中市| 来宾市| 巴中市| 朝阳市| 卓资县| 城市| 吉林市| 阿克陶县| 黔西| 阜平县| 株洲市| 连城县| 黎城县| 海原县| 通江县| 阳泉市| 拉孜县| 宁明县| 昌平区| 高淳县| 建水县| 莱西市| 甘肃省| 绩溪县| 日喀则市| 贵州省| 蛟河市| 巴彦县| 开封县| 长宁县| 翁牛特旗| 宝应县| 遂昌县|