Lines Matching full:if

24 if (strpos(@ini_get('disable_functions'), 'set_time_limit') === false) {
66 if($maxLen <= 0) { $maxLen = MAX_FILE_SIZE; }
80 * retrieve_url_contents line 2 lines down if it is not already done.
91 if (empty($contents) || strlen($contents) > $maxLen) {
118 if (empty($str) || strlen($str) > MAX_FILE_SIZE) {
171 if ($show_attr && count($this->attr) > 0) {
181 if ($this->nodes) {
192 if (count($this->attr) > 0) {
200 if (count($this->_) > 0) {
203 if (is_array($v)) {
216 if (isset($this->text)) {
222 if (isset($node->_[HDOM_INFO_INNER])) {
233 if ($echo) {
246 if ($parent !== null) {
262 if ($idx === -1) {
266 if (isset($this->children[$idx])) {
275 if (count($this->children) > 0) {
283 if (count($this->children) > 0) {
291 if ($this->parent === null) {
297 if ($idx !== false && isset($this->parent->children[$idx + 1])) {
306 if ($this->parent === null) {
312 if ($idx !== false && $idx > 0) {
322 if (is_object($debug_object)) { $debug_object->debug_log_entry(1); }
324 if ($this->parent === null) {
331 if (is_object($debug_object)) {
335 if ($ancestor->tag === $tag) {
347 if (isset($this->_[HDOM_INFO_INNER])) {
351 if (isset($this->_[HDOM_INFO_TEXT])) {
368 if (is_object($debug_object)) {
371 if ($this->tag === 'text') {
372 if (!empty($this->text)) {
380 if ($this->tag === 'root') {
385 if ($this->dom && $this->dom->callback !== null) {
389 if (isset($this->_[HDOM_INFO_OUTER])) {
393 if (isset($this->_[HDOM_INFO_TEXT])) {
399 if ($this->dom && $this->dom->nodes[$this->_[HDOM_INFO_BEGIN]]) {
403 if (isset($this->_[HDOM_INFO_INNER])) {
405 if ($this->tag !== 'br') {
414 if (isset($this->_[HDOM_INFO_END]) && $this->_[HDOM_INFO_END] != 0) {
423 if (isset($this->_[HDOM_INFO_INNER])) {
433 if (strcasecmp($this->tag, 'script') === 0) { return ''; }
434 if (strcasecmp($this->tag, 'style') === 0) { return ''; }
443 if (!is_null($this->nodes)) {
446 if ($n->tag === 'p') {
452 // If this node is a span... add a space at the end of it so
455 if ($n->tag === 'span') {
474 if (isset($this->_[HDOM_INFO_TEXT])) {
485 if ($val === null || $val === false) { continue; }
490 if ($val === true) {
517 if (($count = count($selectors)) === 0) { return array(); }
524 // used to be: if (($levle=count($selectors[0]))===0) return array();
525 if (($levle = count($selectors[$c])) === 0) { return array(); }
526 if (!isset($this->_[HDOM_INFO_BEGIN])) { return array(); }
546 if (!isset($found_keys[$k])) {
561 if (is_null($idx)) { return $found; }
569 if (is_object($debug_object)) { $debug_object->debug_log_entry(1); }
574 if ($parent_cmd === ' ') { // Descendant Combinator
575 // Find parent closing tag if the current element doesn't have a closing
578 if ($end == 0) {
597 if ($index < count($this->parent->children))
607 // Note: If this element is a void tag, any previous void element is
613 if(!$node->parent) {
617 // Skip if node isn't a child node (i.e. text nodes)
618 if($pass && !in_array($node, $node->parent->children, true)) {
622 // Skip if tag doesn't match
623 if ($pass && $tag !== '' && $tag !== $node->tag && $tag !== '*') {
627 // Skip if ID doesn't exist
628 if ($pass && $id !== '' && !isset($node->attr['id'])) {
632 // Check if ID matches
633 if ($pass && $id !== '' && isset($node->attr['id'])) {
637 if($id !== $node_id) { $pass = false; }
640 // Check if all class(es) exist
641 if ($pass && $class !== '' && is_array($class) && !empty($class)) {
642 if (isset($node->attr['class'])) {
645 if ($lowercase) {
650 if(!in_array($c, $node_classes)) {
661 if ($pass
683 if (is_numeric($att_name)
690 if ($c->tag === $node->tag) ++$count;
691 if ($c === $node) break;
694 // If this is the correct node, continue with next
696 if ($count === (int)$att_name) continue;
700 if ($att_inv) { // Attribute should NOT be set
701 if (isset($node->attr[$att_name])) {
707 if ($att_name !== 'plaintext'
714 // Continue with next attribute if expression isn't defined
715 if ($att_expr === '') continue;
717 // If they have told us that this is a "plaintext"
720 if ($att_name === 'plaintext') {
726 if (is_object($debug_object)) {
739 // If lowercase is set, do a case insensitive test of
741 if ($lowercase) {
757 if (is_object($debug_object)) {
764 if (!$check) {
772 if ($pass) $ret[$node->_[HDOM_INFO_BEGIN]] = 1;
776 if (is_object($debug_object)) {
784 if (is_object($debug_object)) {$debug_object->debug_log_entry(1);}
786 if ($case_sensitivity === 'i') {
817 * "val". If "val" contains whitespace, it will never represent
818 * anything (since the words are separated by spaces). Also if
829 if (is_object($debug_object)) { $debug_object->debug_log_entry(1); }
837 * Note: if you try to look at this attribute, you MUST use getAttribute
884 if (is_object($debug_object)) {
895 if ($m[0] === '' || $m[0] === '/' || $m[0] === '//') { continue; }
898 if ($this->dom->lowercase) {
903 if ($m[3] !== '') { $m[3] = explode('.', $m[3]); }
915 if($m[4] !== '') {
928 if(trim($att[0]) === '') { continue; }
942 if ($m[5] !== '' && trim($m[5]) === '') { // Descendant Separator
948 // Clear Separator if it's a Selector List
949 if ($is_list = ($m[5] === ',')) { $m[5] = ''; }
955 if ($is_list) { // Selector List
961 if (count($result) > 0) { $selectors[] = $result; }
967 if (isset($this->attr[$name])) {
982 if (is_object($debug_object)) { $debug_object->debug_log_entry(1); }
987 if (isset($this->_[HDOM_INFO_TEXT])) {
993 if (!isset($this->attr[$name])) {
1014 if (isset($this->attr[$name])) { unset($this->attr[$name]); }
1020 if (is_object($debug_object)) { $debug_object->debug_log_entry(1); }
1027 if ($this->dom) {
1032 if (is_object($debug_object)) {
1041 if (!empty($sourceCharset)
1044 … // Check if the reported encoding could have been incorrect and the text is actually already UTF-8
1045 if ((strcasecmp($targetCharset, 'UTF-8') == 0)
1054 if ($targetCharset === 'UTF-8') {
1055 if (substr($converted_text, 0, 3) === "\xef\xbb\xbf") {
1059 if (substr($converted_text, -3) === "\xef\xbb\xbf") {
1074 if($c > 128) {
1075 if(($c >= 254)) { return false; }
1082 if(($i + $bits) > $len) { return false; }
1086 if($b < 128 || $b > 191) { return false; }
1101 if ($this->tag !== 'img') {
1105 // See if there is aheight or width attribute in the tag itself.
1106 if (isset($this->attr['width'])) {
1110 if (isset($this->attr['height'])) {
1115 if (isset($this->attr['style'])) {
1130 // If there is a width in the style attributes:
1131 if (isset($attributes['width']) && $width == -1) {
1133 if (strtolower(substr($attributes['width'], -2)) === 'px') {
1136 if (filter_var($proposed_width, FILTER_VALIDATE_INT)) {
1142 // If there is a width in the style attributes:
1143 if (isset($attributes['height']) && $height == -1) {
1145 if (strtolower(substr($attributes['height'], -2)) == 'px') {
1148 if (filter_var($proposed_height, FILTER_VALIDATE_INT)) {
1157 // Look in the tag to see if there is a class or id specified that has
1161 // Look at all the parent tags of this image to see if they specify a
1167 // If the class or id is specified in a SEPARATE css file thats not on
1183 if ($filepath !== '') {
1192 if (is_string($class)) {
1196 if (is_array($class)) {
1198 if (isset($this->class)) {
1199 if ($this->hasClass($c)) {
1209 if (is_object($debug_object)) {
1217 if (is_string($class)) {
1218 if (isset($this->class)) {
1222 if (is_object($debug_object)) {
1232 if (!isset($this->class)) {
1236 if (is_null($class)) {
1241 if (is_string($class)) {
1245 if (is_array($class)) {
1247 if (empty($class)) {
1282 if ($this->parent) {
1293 if ($nidx !== false && $cidx !== false && $didx !== false) {
1303 if ($enidx !== false && $edidx !== false) {
1468 if ($str) {
1469 if (preg_match('/^http:\/\//i', $str) || is_file($str)) {
1483 // it can lead to parsing errors if we SHOULD trust the html.
1484 if (!$forceTagsClosed) {
1515 // strip out the \r \n's if we are told to.
1516 if ($stripRN) {
1536 if($options & HDOM_SMARTY_AS_TEXT) { // Strip Smarty scripts
1554 if(($doc = call_user_func_array('file_get_contents', $args)) !== false) {
1574 if ($filepath !== '') { file_put_contents($filepath, $ret, LOCK_EX); }
1585 if (isset($this->nodes)) {
1595 if (isset($this->children)) {
1602 if (isset($this->parent)) {
1607 if (isset($this->root)) {
1643 if ($this->size > 0) { $this->char = $this->doc[0]; }
1649 // Read next tag if there is no text between current position and the
1651 if (($s = $this->copy_until_char('<')) === '') {
1652 if($this->read_tag()) {
1673 if (function_exists('get_last_retrieve_url_contents_content_type')) {
1676 if ($success) {
1678 if (is_object($debug_object)) {
1687 if (empty($charset)) {
1691 if (!empty($el)) {
1693 if (is_object($debug_object)) {
1700 if (!empty($fullvalue)) {
1707 if ($success) {
1710 // If there is a meta tag, and they don't specify the
1713 if (is_object($debug_object)) {
1725 if (empty($charset)) {
1727 if ($meta = $this->root->find('meta[charset]', 0)) {
1729 if (is_object($debug_object)) {
1735 if (empty($charset)) {
1738 if (function_exists('mb_detect_encoding')) {
1750 * Thus, only detect if it's either UTF-8 or CP1252/ISO-8859-1
1758 if ($encoding === 'CP1252' || $encoding === 'ISO-8859-1') {
1763 if (!@iconv('CP1252', 'UTF-8', $this->doc)) {
1768 if ($encoding !== false) {
1770 if (is_object($debug_object)) {
1777 if (empty($charset)) {
1780 if (is_object($debug_object)) {
1785 // Since CP1252 is a superset, if we get one of it's subsets, we want
1787 if ((strtolower($charset) == 'iso-8859-1')
1791 if (is_object($debug_object)) {
1798 if (is_object($debug_object)) {
1807 // Set end position if no further tags found
1808 if ($this->char !== '<') {
1817 if ($this->char === '/') {
1825 if (($pos = strpos($tag, ' ')) !== false) {
1834 if ($parent_lower !== $tag_lower) {
1837 if (isset($this->optional_closing_tags[$parent_lower])
1851 // If we don't have a match add current tag as text node
1852 if (strtolower($this->parent->tag) !== $tag_lower) {
1855 if ($this->parent->parent) {
1878 // If we don't have a match add current tag as text node
1879 if (strtolower($this->parent->tag) !== $tag_lower) {
1897 if ($this->parent->parent) {
1916 if (isset($tag[0]) && $tag[0] === '!') {
1919 if (isset($tag[2]) && $tag[1] === '-' && $tag[2] === '-') { // Comment ("<!--")
1927 if ($this->char === '>') { $node->_[HDOM_INFO_TEXT] .= '>'; }
1934 // The start tag cannot contain another start tag, if so add as text
1936 if ($pos = strpos($tag, '<') !== false) {
1945 if (!preg_match('/^\w[\w:-]*$/', $tag)) {
1949 if ($this->char === '<') {
1955 if ($this->char === '>') { $node->_[HDOM_INFO_TEXT] .= '>'; }
1967 if (isset($this->optional_closing_tags[$tag_lower])) {
1986 if ($name === '' && $this->char !== null && $space[0] === '') {
1990 if ($guard === $this->pos) { // Escape infinite loop
1999 if ($this->pos >= $this->size - 1 && $this->char !== '>') {
2010 if ($this->doc[$this->pos - 1] == '<') {
2026 if ($name !== '/' && $name !== '') { // this is a attribute name
2032 if ($this->lowercase) { $name = strtolower($name); }
2034 if ($this->char === '=') { // attribute with value
2041 if ($this->char != '>') { $this->char = $this->doc[--$this->pos]; } // prev
2061 if ($this->copy_until_char('>') === '/') {
2066 if (!isset($this->self_closing_tags[strtolower($node->tag)])) {
2073 // If it's a BR tag, we need to set it's text to the default text.
2076 if ($node->tag === 'br') {
2087 if (!$is_duplicate) // Copy whitespace between "=" and value
2114 if ($this->strip_rn) {
2119 // PaperG: If this is a "class" selector, lets get rid of the preceeding
2121 if ($name === 'class') {
2125 if (!$is_duplicate) {
2135 if ($is_child) {
2162 if ($len === 0) { return ''; }
2177 if ($this->char === null) { return ''; }
2179 if (($pos = strpos($this->doc, $char, $this->pos)) === false) {
2186 if ($pos === $this->pos) { return ''; }
2197 if (is_object($debug_object)) { $debug_object->debug_log_entry(1); }
2209 if (is_object($debug_object)) {
2221 if ($this->size > 0) {
2229 if (is_object($debug_object)) { $debug_object->debug_log_entry(1); }
2238 if (strlen($text) > $pos + 15) {
2246 if (is_object($debug_object)) {
2250 if (isset($this->noise[$key])) {
2275 if (is_object($debug_object)) { $debug_object->debug_log_entry(1); }
2278 if (strpos($noiseElement, $text) !== false) {