> For the complete documentation index, see [llms.txt](https://playground.e107sk.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://playground.e107sk.com/e107-efiction-integration-update/outdated/core-functions.md).

# Core Functions

Functions from file includes/corefunctions.php

New file: inc/corefunctions.php

{% hint style="info" %}
Decided not to replace those functions in the code directly. With wrong replacement, it is easier to change this way.
{% endhint %}

| Function              | Replacement                                     | Purpose                                                                            |
| --------------------- | ----------------------------------------------- | ---------------------------------------------------------------------------------- |
| `descript($text)`     | `e107::getParser()->toDB($text)`                | Sanitizes user input to help prevent XSS attacks                                   |
| `isNumber($num)`      | `e107::getParser()->filter($num, 'int');`       | Checks that the given $num is actually a number. Used to help prevent XSS attacks. |
| `write_error($str)`   | `e107::getMessage()->addError($str)->render();` | Formats error messages sent back from various forms and actions                    |
| `write_message($str)` |                                                 |                                                                                    |
