-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path_function.getHTMLBody.php
More file actions
executable file
·41 lines (36 loc) · 1.79 KB
/
Copy path_function.getHTMLBody.php
File metadata and controls
executable file
·41 lines (36 loc) · 1.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?php
// +----------------------------------------------------------------------+
// | MicroFrabster v0.9.7 |
// +----------------------------------------------------------------------+
// | Copyright (c) 2005 - 2011 Selincite.com |
// +----------------------------------------------------------------------+
// | This code is released under the Mozilla Public License Version 1.1
// | See http://www.mozilla.org/MPL/MPL-1.1.html for full details.
// | For more informatino about licensing, and/or further development |
// | we encourage you to contact us - we're not evil. :) |
// +----------------------------------------------------------------------+
// | Authors: Jocke Selin <jocke@selincite.com> |
// +----------------------------------------------------------------------+
//
/* File purpose:
Function that retreieves the body-tag from the HTML
*/
function getHTMLBody($sHTML)
{
if (strlen($sHTML) > 0) {
// Yes, I know this could be done by using regular expressions, but most
// non-programmers see that as voodoo, this is plain non-voodoo software.
$iBodyStartPos = strpos($sHTML, "<body");
$sHTML = substr($sHTML, $iBodyStartPos + 5);
$iBodyStartEndPos = strpos($sHTML, ">");
$sHTML = substr($sHTML, $iBodyStartEndPos + 1);
$iBodyStartPos = strpos($sHTML, "</body>");
$sHTML = substr($sHTML, 0, $iBodyStartPos);
// Debugging
// print("<hr />" . htmlentities($sHTML) . "<hr />");
return $sHTML;
} else {
renderErrorMessage("The system wanted to format the content but was passed empty content.", "Empty HTML variable in File: " . __FILE__);
}
}
?>