checkPageSubjectInUrl.
Checks if defined PageSubject is present in the Page URLSegment

@param none
@return boolean
351839
public function checkPageSubjectInUrl() {
        if ($this->checkPageSubjectDefined()) {

            $url_segment             = $this->owner->URLSegment;
            $pagesubject_url_segment = $this->owner->generateURLSegment($this->owner->SEOPageSubject);

            if (preg_match('/' . preg_quote($pagesubject_url_segment, '/') . '/i', $url_segment)) {
                return true;
            }
            else {
                return false;
            }
        }
        return false;

    }
1336362
def is_page?(check = nil)

      return false if @content.blank? || !@content[0].blank?
      return true if @content.post_type == 'page' && check.blank?
      return true if @content.id == check.to_i
      return false

    end
70735
def needs_pagination(self):
        """"""
        if self.objects_per_page == 0:
            return False
        if len(self.items) > self.objects_per_page \
                or len(self.get_pages[0]) > self.objects_per_page:
            return True
        return False
879324
function isUrl(string){
    if (typeof string !== 'string') {
      return false;
    }

    var match = string.match(protocolAndDomainRE);
    if (!match) {
      return false;
    }

    var everythingAfterProtocol = match[1];
    if (!everythingAfterProtocol) {
      return false;
    }

    return localhostDomainRE.test(everythingAfterProtocol) ||
        nonLocalhostDomainRE.test(everythingAfterProtocol);
  }
560631
def check_page(fn):
        ""
        @wraps(fn)
        def wrapper(self, *args, **kwargs):
            if not self.page and not kwargs.get('split_only'):
                self.error("No page open, you need to call add_page() first")
            else:
                return fn(self, *args, **kwargs)
        return wrapper
50724
public boolean hasSearchPages() {
		try {
			return this.getClass().getMethod("createSearchPage", new Class<?>[] { String.class }).getDeclaringClass() != Application.class;
		} catch (NoSuchMethodException | SecurityException e) {
			throw new RuntimeException(e);
		}
	}
400009
def if_url(context, url_name, yes, no):
    
    current = context["request"].resolver_match.url_name
    return yes if url_name == current else no
202888
def page_match(name, path)
      if (match = self.class.valid_filename?(path))
        @wiki.ws_subs.each do |sub|
          return true if Page.cname(name).downcase == Page.cname(match, sub).downcase
        end
      end
      false
    end
1071768
public function checkPageSubjectInImageAltTags() {

        $html = $this->getPageContent();

        // for newly created page
        if ($html == '') {
            return false;
        }

        $dom = $this->createDOMDocumentFromHTML($html);

        $images = $dom->getElementsByTagName('img');

        foreach($images as $image){
            if($image->hasAttribute('alt') && $image->getAttribute('alt') != ''){
                if (preg_match('/' . preg_quote($this->owner->SEOPageSubject, '/') . '/i', $image->getAttribute('alt'))) {
                    return true;
                }
            }
        }

        return false;
    }
12017
private function checkPageHasImages() {

        $html = $this->getPageContent();

        // for newly created page
        if ($html == '') {
            return false;
        }

        $dom = $this->createDOMDocumentFromHTML($html);

        $elements = $dom->getElementsByTagName('img');
        return ($elements->length) ? true : false;

    }
1118974
private boolean isInSubsite(List<String> subSitePaths, String path) {

        boolean result = false;
        for (String subSite : subSitePaths) {
            if (path.startsWith(subSite)) {
                result = true;
                break;
            }
        }
        return result;
    }
1112735
def page=(value)
      return if @page == value
      @page = value

      if @page.respond_to?("getDocumentElement")
        @object = @page.getDocumentElement || @object
      elsif @page.is_a? HtmlUnit::UnexpectedPage
        raise UnexpectedPageException, @page.getWebResponse.getContentType
      end

      render unless @viewer == DefaultViewer
      run_error_checks

      value
    end
305883
public function augmentValidURLSegment()
    {
        // If this page is being filtered in the current subsite, then no custom validation query is required.
        $subsite = Subsite::$force_subsite ?: SubsiteState::singleton()->getSubsiteId();
        if (empty($this->owner->SubsiteID) || $subsite == $this->owner->SubsiteID) {
            return null;
        }

        // Backup forced subsite
        $prevForceSubsite = Subsite::$force_subsite;
        Subsite::$force_subsite = $this->owner->SubsiteID;

        // Repeat validation in the correct subsite
        $isValid = $this->owner->validURLSegment();

        // Restore
        Subsite::$force_subsite = $prevForceSubsite;

        return (bool)$isValid;
    }
932547
def is_subdomain(domain, reference):
    
    index_of_reference = domain.find(reference)
    if index_of_reference > 0 and domain[index_of_reference:] == reference:
        return True
    return False
658680
private boolean isEmptyObject()
    {
        boolean retVal = false;

        /**
         * Check for no attributes
         */
        if (this.attrs == null || (this.attrs != null && this.attrs.isEmpty()))
        {
            /**
             * Check for no sub-children
             */
            if (this.jsonObjects.isEmpty())
            {
                /**
                 * Check for no tag text.
                 */
                if (this.tagText == null || (this.tagText != null && this.tagText.trim().equals("")))
                {
                    retVal = true;
                }
            }
        }

        return retVal;
    }
1096756
protected function smartUrlCheck()
    {
        if (empty($this->obElementItem)) {
            return false;
        }

        $sCurrentURL = $this->currentPageUrl();
        $sValidURL = $this->obElementItem->getPageUrl($this->page->id);
        $bResult = $sCurrentURL == $sValidURL;

        return $bResult;
    }
886736
public function validURLSegment()
    {
        $list = DataList::create(get_class($this->owner))->filter(['URLSegment' => $this->owner->URLSegment]);
        
        if ($id = $this->owner->ID) {
            $list = $list->exclude(['ID' => $id]);
        }
        
        return !$list->exists();
    }