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

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
主站蜘蛛池模板: 乌海市| 蚌埠市| 剑川县| 额济纳旗| 婺源县| 聂荣县| 青田县| 勃利县| 南部县| 确山县| 五寨县| 兴业县| 公主岭市| 蒙自县| 塔河县| 桃源县| 内丘县| 建阳市| 咸丰县| 沅江市| 衡阳县| 农安县| 嘉兴市| 嘉黎县| 炉霍县| 崇州市| 威海市| 许昌市| 栖霞市| 二连浩特市| 孙吴县| 浪卡子县| 田阳县| 麦盖提县| 康保县| 昌邑市| 宝丰县| 美姑县| 东阿县| 达州市| 廊坊市|