You are here

function rabbit_hole_contains_php in Rabbit Hole 7.2

Determines if the provided string contains any PHP code or not.

Parameters

string $code: The code that we should search for PHP opening and closure tags.

Return value

bool TRUE or FALSE depending on wether or not the code contains both the opening and closure tags.

3 calls to rabbit_hole_contains_php()
rabbit_hole_execute in ./rabbit_hole.module
Determines the action that should be executed.
rabbit_hole_form in ./rabbit_hole.module
Form structure for the Rabbit Hole configuration.
rabbit_hole_form_validate in ./rabbit_hole.module
Validation callback for the Rabbit Hole form.

File

./rabbit_hole.module, line 384
Main module file for Rabbit Hole.

Code

function rabbit_hole_contains_php($code) {
  return strpos($code, '<?php') !== FALSE && strpos($code, '?>') !== FALSE;
}