Function __global->check_comcode
Definitions
sources/comcode_check.php
- Check the Comcode is valid.
- Visibility: public
- Is abstract?: No
- Is static?: No
- Is final?: No
Parameters
| Name | Type | Passed by reference? | Variadic? | Default | Set | Range | Description |
|---|---|---|---|---|---|---|---|
| $comcode | LONG_TEXT | No | No | required parameter | N/A | N/A | The Comcode to convert |
| $source_member | ?MEMBER | No | No | Null | N/A | N/A | The member the evaluation is running as. This is a security issue, and you should only run as an administrator if you have considered where the Comcode came from carefully (null: current member) |
| $as_admin | boolean | No | No | False | N/A | N/A | Whether to explicitly execute this with admin rights. There are a few rare situations where this should be done, for data you know didn't come from a member, but is being evaluated by one. |
| $db | ?object | No | No | Null | N/A | N/A | The database connector to use (null: standard site connector) |
| $attachment_possibility | boolean | No | No | False | N/A | N/A | Whether there might be new attachments. If there are, we will check as lax- as attachments are always preserved by forcing lax parsing. |
Preview
Code (PHP)
/**
* Check the Comcode is valid.
*
* @param LONG_TEXT $comcode The Comcode to convert
* @param ?MEMBER $source_member The member the evaluation is running as. This is a security issue, and you should only run as an administrator if you have considered where the Comcode came from carefully (null: current member)
* @param boolean $as_admin Whether to explicitly execute this with admin rights. There are a few rare situations where this should be done, for data you know didn't come from a member, but is being evaluated by one.
* @param ?object $db The database connector to use (null: standard site connector)
* @param boolean $attachment_possibility Whether there might be new attachments. If there are, we will check as lax- as attachments are always preserved by forcing lax parsing.
*/
function check_comcode(string $comcode, ?int $source_member = null, bool $as_admin = false, ?object $db = null, bool $attachment_possibility = false)
* Check the Comcode is valid.
*
* @param LONG_TEXT $comcode The Comcode to convert
* @param ?MEMBER $source_member The member the evaluation is running as. This is a security issue, and you should only run as an administrator if you have considered where the Comcode came from carefully (null: current member)
* @param boolean $as_admin Whether to explicitly execute this with admin rights. There are a few rare situations where this should be done, for data you know didn't come from a member, but is being evaluated by one.
* @param ?object $db The database connector to use (null: standard site connector)
* @param boolean $attachment_possibility Whether there might be new attachments. If there are, we will check as lax- as attachments are always preserved by forcing lax parsing.
*/
function check_comcode(string $comcode, ?int $source_member = null, bool $as_admin = false, ?object $db = null, bool $attachment_possibility = false)

