Lines Matching full:if

63 	if($maxLen <= 0) { $maxLen = MAX_FILE_SIZE; }
77 * retrieve_url_contents line 2 lines down if it is not already done.
88 if (empty($contents) || strlen($contents) > $maxLen) {
115 if (empty($str) || strlen($str) > MAX_FILE_SIZE) {
168 if ($show_attr && count($this->attr) > 0) {
178 if ($this->nodes) {
189 if (count($this->attr) > 0) {
197 if (count($this->_) > 0) {
200 if (is_array($v)) {
213 if (isset($this->text)) {
219 if (isset($node->_[HDOM_INFO_INNER])) {
230 if ($echo) {
243 if ($parent !== null) {
259 if ($idx === -1) {
263 if (isset($this->children[$idx])) {
272 if (count($this->children) > 0) {
280 if (count($this->children) > 0) {
288 if ($this->parent === null) {
294 if ($idx !== false && isset($this->parent->children[$idx + 1])) {
303 if ($this->parent === null) {
309 if ($idx !== false && $idx > 0) {
319 if (is_object($debug_object)) { $debug_object->debug_log_entry(1); }
321 if ($this->parent === null) {
328 if (is_object($debug_object)) {
332 if ($ancestor->tag === $tag) {
344 if (isset($this->_[HDOM_INFO_INNER])) {
348 if (isset($this->_[HDOM_INFO_TEXT])) {
365 if (is_object($debug_object)) {
368 if ($this->tag === 'text') {
369 if (!empty($this->text)) {
377 if ($this->tag === 'root') {
382 if ($this->dom && $this->dom->callback !== null) {
386 if (isset($this->_[HDOM_INFO_OUTER])) {
390 if (isset($this->_[HDOM_INFO_TEXT])) {
396 if ($this->dom && $this->dom->nodes[$this->_[HDOM_INFO_BEGIN]]) {
400 if (isset($this->_[HDOM_INFO_INNER])) {
402 if ($this->tag !== 'br') {
411 if (isset($this->_[HDOM_INFO_END]) && $this->_[HDOM_INFO_END] != 0) {
420 if (isset($this->_[HDOM_INFO_INNER])) {
430 if (strcasecmp($this->tag, 'script') === 0) { return ''; }
431 if (strcasecmp($this->tag, 'style') === 0) { return ''; }
440 if (!is_null($this->nodes)) {
443 if ($n->tag === 'p') {
449 // If this node is a span... add a space at the end of it so
452 if ($n->tag === 'span') {
471 if (isset($this->_[HDOM_INFO_TEXT])) {
482 if ($val === null || $val === false) { continue; }
487 if ($val === true) {
514 if (($count = count($selectors)) === 0) { return array(); }
521 // used to be: if (($levle=count($selectors[0]))===0) return array();
522 if (($levle = count($selectors[$c])) === 0) { return array(); }
523 if (!isset($this->_[HDOM_INFO_BEGIN])) { return array(); }
543 if (!isset($found_keys[$k])) {
558 if (is_null($idx)) { return $found; }
566 if (is_object($debug_object)) { $debug_object->debug_log_entry(1); }
571 if ($parent_cmd === ' ') { // Descendant Combinator
572 // Find parent closing tag if the current element doesn't have a closing
575 if ($end == 0) {
594 if ($index < count($this->parent->children))
604 // Note: If this element is a void tag, any previous void element is
610 if(!$node->parent) {
615 if($pass && $tag === 'text' && $node->tag === 'text') {
621 // Skip if node isn't a child node (i.e. text nodes)
622 if($pass && !in_array($node, $node->parent->children, true)) {
626 // Skip if tag doesn't match
627 if ($pass && $tag !== '' && $tag !== $node->tag && $tag !== '*') {
631 // Skip if ID doesn't exist
632 if ($pass && $id !== '' && !isset($node->attr['id'])) {
636 // Check if ID matches
637 if ($pass && $id !== '' && isset($node->attr['id'])) {
641 if($id !== $node_id) { $pass = false; }
644 // Check if all class(es) exist
645 if ($pass && $class !== '' && is_array($class) && !empty($class)) {
646 if (isset($node->attr['class'])) {
649 if ($lowercase) {
654 if(!in_array($c, $node_classes)) {
665 if ($pass
687 if (is_numeric($att_name)
694 if ($c->tag === $node->tag) ++$count;
695 if ($c === $node) break;
698 // If this is the correct node, continue with next
700 if ($count === (int)$att_name) continue;
704 if ($att_inv) { // Attribute should NOT be set
705 if (isset($node->attr[$att_name])) {
711 if ($att_name !== 'plaintext'
718 // Continue with next attribute if expression isn't defined
719 if ($att_expr === '') continue;
721 // If they have told us that this is a "plaintext"
724 if ($att_name === 'plaintext') {
730 if (is_object($debug_object)) {
743 // If lowercase is set, do a case insensitive test of
745 if ($lowercase) {
761 if (is_object($debug_object)) {
768 if (!$check) {
776 if ($pass) $ret[$node->_[HDOM_INFO_BEGIN]] = 1;
780 if (is_object($debug_object)) {
788 if (is_object($debug_object)) {$debug_object->debug_log_entry(1);}
790 if ($case_sensitivity === 'i') {
821 * "val". If "val" contains whitespace, it will never represent
822 * anything (since the words are separated by spaces). Also if
833 if (is_object($debug_object)) { $debug_object->debug_log_entry(1); }
841 * Note: if you try to look at this attribute, you MUST use getAttribute
888 if (is_object($debug_object)) {
899 if ($m[0] === '' || $m[0] === '/' || $m[0] === '//') { continue; }
902 if ($this->dom->lowercase) {
907 if ($m[3] !== '') { $m[3] = explode('.', $m[3]); }
919 if($m[4] !== '') {
932 if(trim($att[0]) === '') { continue; }
946 if ($m[5] !== '' && trim($m[5]) === '') { // Descendant Separator
952 // Clear Separator if it's a Selector List
953 if ($is_list = ($m[5] === ',')) { $m[5] = ''; }
959 if ($is_list) { // Selector List
965 if (count($result) > 0) { $selectors[] = $result; }
971 if (isset($this->attr[$name])) {
986 if (is_object($debug_object)) { $debug_object->debug_log_entry(1); }
991 if (isset($this->_[HDOM_INFO_TEXT])) {
997 if (!isset($this->attr[$name])) {
1018 if (isset($this->attr[$name])) { unset($this->attr[$name]); }
1024 if (is_object($debug_object)) { $debug_object->debug_log_entry(1); }
1031 if ($this->dom) {
1036 if (is_object($debug_object)) {
1045 if (!empty($sourceCharset)
1048 … // Check if the reported encoding could have been incorrect and the text is actually already UTF-8
1049 if ((strcasecmp($targetCharset, 'UTF-8') == 0)
1058 if ($targetCharset === 'UTF-8') {
1059 if (substr($converted_text, 0, 3) === "\xef\xbb\xbf") {
1063 if (substr($converted_text, -3) === "\xef\xbb\xbf") {
1078 if($c > 128) {
1079 if(($c >= 254)) { return false; }
1086 if(($i + $bits) > $len) { return false; }
1090 if($b < 128 || $b > 191) { return false; }
1105 if ($this->tag !== 'img') {
1109 // See if there is aheight or width attribute in the tag itself.
1110 if (isset($this->attr['width'])) {
1114 if (isset($this->attr['height'])) {
1119 if (isset($this->attr['style'])) {
1134 // If there is a width in the style attributes:
1135 if (isset($attributes['width']) && $width == -1) {
1137 if (strtolower(substr($attributes['width'], -2)) === 'px') {
1140 if (filter_var($proposed_width, FILTER_VALIDATE_INT)) {
1146 // If there is a width in the style attributes:
1147 if (isset($attributes['height']) && $height == -1) {
1149 if (strtolower(substr($attributes['height'], -2)) == 'px') {
1152 if (filter_var($proposed_height, FILTER_VALIDATE_INT)) {
1161 // Look in the tag to see if there is a class or id specified that has
1165 // Look at all the parent tags of this image to see if they specify a
1171 // If the class or id is specified in a SEPARATE css file thats not on
1187 if ($filepath !== '') {
1196 if (is_string($class)) {
1200 if (is_array($class)) {
1202 if (isset($this->class)) {
1203 if ($this->hasClass($c)) {
1213 if (is_object($debug_object)) {
1221 if (is_string($class)) {
1222 if (isset($this->class)) {
1226 if (is_object($debug_object)) {
1236 if (!isset($this->class)) {
1240 if (is_null($class)) {
1245 if (is_string($class)) {
1249 if (is_array($class)) {
1251 if (empty($class)) {
1286 if ($this->parent) {
1297 if ($nidx !== false && $cidx !== false && $didx !== false) {
1307 if ($enidx !== false && $edidx !== false) {
1474 if ($str) {
1475 if (preg_match('/^http:\/\//i', $str) || is_file($str)) {
1489 // it can lead to parsing errors if we SHOULD trust the html.
1490 if (!$forceTagsClosed) {
1521 // strip out the \r \n's if we are told to.
1522 if ($stripRN) {
1542 if($options & HDOM_SMARTY_AS_TEXT) { // Strip Smarty scripts
1560 if(($doc = call_user_func_array('file_get_contents', $args)) !== false) {
1580 if ($filepath !== '') { file_put_contents($filepath, $ret, LOCK_EX); }
1591 if (isset($this->nodes)) {
1601 if (isset($this->children)) {
1608 if (isset($this->parent)) {
1613 if (isset($this->root)) {
1649 if ($this->size > 0) { $this->char = $this->doc[0]; }
1655 // Read next tag if there is no text between current position and the
1657 if (($s = $this->copy_until_char('<')) === '') {
1658 if($this->read_tag()) {
1679 if (function_exists('get_last_retrieve_url_contents_content_type')) {
1682 if ($success) {
1684 if (is_object($debug_object)) {
1693 if (empty($charset)) {
1697 if (!empty($el)) {
1699 if (is_object($debug_object)) {
1706 if (!empty($fullvalue)) {
1713 if ($success) {
1716 // If there is a meta tag, and they don't specify the
1719 if (is_object($debug_object)) {
1731 if (empty($charset)) {
1733 if ($meta = $this->root->find('meta[charset]', 0)) {
1735 if (is_object($debug_object)) {
1741 if (empty($charset)) {
1744 if (function_exists('mb_detect_encoding')) {
1756 * Thus, only detect if it's either UTF-8 or CP1252/ISO-8859-1
1764 if ($encoding === 'CP1252' || $encoding === 'ISO-8859-1') {
1769 if (!@iconv('CP1252', 'UTF-8', $this->doc)) {
1774 if ($encoding !== false) {
1776 if (is_object($debug_object)) {
1783 if (empty($charset)) {
1786 if (is_object($debug_object)) {
1791 // Since CP1252 is a superset, if we get one of it's subsets, we want
1793 if ((strtolower($charset) == 'iso-8859-1')
1797 if (is_object($debug_object)) {
1804 if (is_object($debug_object)) {
1813 // Set end position if no further tags found
1814 if ($this->char !== '<') {
1823 if ($this->char === '/') {
1831 if (($pos = strpos($tag, ' ')) !== false) {
1840 if ($parent_lower !== $tag_lower) {
1843 if (isset($this->optional_closing_tags[$parent_lower])
1857 // If we don't have a match add current tag as text node
1858 if (strtolower($this->parent->tag) !== $tag_lower) {
1861 if ($this->parent->parent) {
1884 // If we don't have a match add current tag as text node
1885 if (strtolower($this->parent->tag) !== $tag_lower) {
1903 if ($this->parent->parent) {
1922 if (isset($tag[0]) && $tag[0] === '!') {
1925 if (isset($tag[2]) && $tag[1] === '-' && $tag[2] === '-') { // Comment ("<!--")
1933 if ($this->char === '>') { $node->_[HDOM_INFO_TEXT] .= '>'; }
1940 // The start tag cannot contain another start tag, if so add as text
1942 if ($pos = strpos($tag, '<') !== false) {
1951 if (!preg_match('/^\w[\w:-]*$/', $tag)) {
1955 if ($this->char === '<') {
1961 if ($this->char === '>') { $node->_[HDOM_INFO_TEXT] .= '>'; }
1973 if (isset($this->optional_closing_tags[$tag_lower])) {
1992 if ($name === '' && $this->char !== null && $space[0] === '') {
1996 if ($guard === $this->pos) { // Escape infinite loop
2005 if ($this->pos >= $this->size - 1 && $this->char !== '>') {
2016 if ($this->doc[$this->pos - 1] == '<') {
2032 if ($name !== '/' && $name !== '') { // this is a attribute name
2038 if ($this->lowercase) { $name = strtolower($name); }
2040 if ($this->char === '=') { // attribute with value
2047 if ($this->char != '>') { $this->char = $this->doc[--$this->pos]; } // prev
2067 if ($this->copy_until_char('>') === '/') {
2072 if (!isset($this->self_closing_tags[strtolower($node->tag)])) {
2079 // If it's a BR tag, we need to set it's text to the default text.
2082 if ($node->tag === 'br') {
2093 if (!$is_duplicate) // Copy whitespace between "=" and value
2120 if($this->stripRNAttrValues) {
2125 // PaperG: If this is a "class" selector, lets get rid of the preceeding
2127 if ($name === 'class') {
2131 if (!$is_duplicate) {
2141 if ($is_child) {
2168 if ($len === 0) { return ''; }
2183 if ($this->char === null) { return ''; }
2185 if (($pos = strpos($this->doc, $char, $this->pos)) === false) {
2192 if ($pos === $this->pos) { return ''; }
2203 if (is_object($debug_object)) { $debug_object->debug_log_entry(1); }
2215 if (is_object($debug_object)) {
2227 if ($this->size > 0) {
2235 if (is_object($debug_object)) { $debug_object->debug_log_entry(1); }
2244 if (strlen($text) > $pos + 15) {
2252 if (is_object($debug_object)) {
2256 if (isset($this->noise[$key])) {
2281 if (is_object($debug_object)) { $debug_object->debug_log_entry(1); }
2284 if (strpos($noiseElement, $text) !== false) {