Confirm that the current page is valid.
163610
public function validate() {

		$parent = $this->getParent();

		// The URL segment will conflict with a year/month/day/media format when numeric.

		if(is_numeric($this->URLSegment) || !($parent instanceof MediaHolder) || ($this->MediaTypeID && ($parent->MediaTypeID != $this->MediaTypeID))) {

			// Customise a validation error message.

			if(is_numeric($this->URLSegment)) {
				$message = '"URL Segment" must not be numeric!';
			}
			else if(!($parent instanceof MediaHolder)) {
				$message = 'The parent needs to be a published media holder!';
			}
			else {
				$message = "The media holder type doesn't match this!";
			}
			$error = new HTTPResponse_Exception($message, 403);
			$error->getResponse()->addHeader('X-Status', rawurlencode($message));

			// Allow extension customisation.

			$this->extend('validateMediaPage', $error);
			throw $error;
		}
		return parent::validate();
	}
486875
function _isValid(el, currentPath) {
	// Link has no destination URL
	if (! el.href) { return false; }

	// Link opens a new browser window
	if (el.target === '_blank') { return false; }

	// Link is not absolute URL
	if (! /https?:/.test(el.href)) { return false; }

	// Link is a download
	if (el.hasAttribute('download')) { return false; }

	// Link is supposed to be ignored
	if (el.hasAttribute('data-static')) { return false; }

	// Link is external URL
	if (el.host && el.host !== location.host) { return false; }

	// Link is current page, but with a hash added
	if (el.hash && el.pathname === currentPath) { return false; }

	return true;
}
332467
function(status) {

      // Page is now opened
      pageInformation.isOpened = true;
      pageInformation.status = status;

      // Failing
      if (status !== 'success') {
        parent.replyTo(callId, wrapFailure('fail'));
        return cleanup();
      }

      // Wrong status code
      if (!pageInformation.response.status || pageInformation.response.status >= 400) {
        parent.replyTo(callId, wrapFailure('status'));
        return cleanup();
      }

      // Waiting for body to load
      page.evaluateAsync(function() {
        var interval = setInterval(function() {
          if (document.readyState === 'complete' || document.readyState === 'interactive') {
            clearInterval(interval);
            window.callPhantom({
              head: 'documentReady',
              body: true,
              passphrase: 'detoo'
            });
          }
        }, 30);
      });
    }
297150
public function valid()
    {
        if ($this->flags & SplFileObject::READ_AHEAD) {
            return $this->current() !== false;
        }

        return !feof($this->stream);
    }
978885
def _valid(m, comment=VALID_RESPONSE, out=None):
    '''
    
    '''
    return _set_status(m, status=True, comment=comment, out=out)
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
687450
def confirm_login():
    '''
    
    '''
    session['_fresh'] = True
    session['_id'] = current_app.login_manager._session_identifier_generator()
    user_login_confirmed.send(current_app._get_current_object())
910376
public function isActive(): bool
    {
        if (! isset($_SERVER['REQUEST_URI'])) { // Input var okay.
            return false;
        }

        $currentUrl = esc_url_raw(
            wp_unslash($_SERVER['REQUEST_URI'])  // Input var okay.
        );

        $matchUrl = str_replace(
            esc_url_raw(get_site_url()),
            '',
            esc_url_raw($this->getUrl())
        );

        return 0 === strpos($currentUrl, $matchUrl);
    }
850017
def valid(self):
        """"""

        now = timezone.now()
        return self.filter(revoked=False, expires__gt=now, valid_from__lt=now)
567102
public function valid()
    {
        if ($this->_currentPage == 0 || $this->_index % $this->_pageSize == 0 && $this->_index < $this->_totalItems)
        {
            $this->_getNextPage();
        }

        return $this->_index < $this->_totalItems;
    }
1355174
public boolean showNextPage(AbstractWizardPage nextPage) {
		if (nextPage == null) {
			// Next page is null. Updating buttons and ignoring request.
			updateButtons();
			return false;
		}
		if (currentPage != null) {
			pageHistory.push(currentPage);
		}
		setPage(nextPage);
		return true;
	}
610376
@SuppressWarnings("deprecation")
  public boolean acceptPage(@Nullable Page page, @NotNull InternalLinkResolverOptions options) {
    if (page == null) {
      return false;
    }

    // check for jcr:content node
    if (!page.hasContent()) {
      return false;
    }

    // check if page is valid concerning on/off-time (only in publish environment)
    if (RunMode.isPublish(slingSettings.getRunModes()) && !page.isValid()) {
      return false;
    }

    // check if page is acceptable based on link handler config
    if (!linkHandlerConfig.isValidLinkTarget(page)) {
      return false;
    }

    return true;
  }
387528
private function validateCorrectProperties()
    {
        if (!is_bool($this->current_page_link)) {
            $this->current_page_link = false;
        }

        if (!is_bool($this->first_page_always_show)) {
            $this->first_page_always_show = false;
        }

        if (is_numeric($this->items_per_page)) {
            $this->items_per_page = intval($this->items_per_page);
            if ($this->items_per_page <= 0) {
                $this->items_per_page = 10;
            }
        } elseif (!is_numeric($this->items_per_page)) {
            $this->items_per_page = 10;
        }

        if (!is_bool($this->last_page_always_show)) {
            $this->last_page_always_show = false;
        }

        if (!is_bool($this->next_page_always_show)) {
            $this->next_page_always_show = false;
        }

        if (is_numeric($this->number_adjacent_pages)) {
            $this->number_adjacent_pages = intval($this->number_adjacent_pages);
            if ($this->number_adjacent_pages < 0) {
                $this->number_adjacent_pages = 5;
            }
        } else {
            $this->number_adjacent_pages = 5;
        }

        if (!is_bool($this->number_display)) {
            $this->number_display = false;
        }

        if ($this->page_number_type != 'start_num' && $this->page_number_type != 'page_num') {
            $this->page_number_type = 'start_num';
        }

        if (!is_bool($this->previous_page_always_show)) {
            $this->previous_page_always_show = false;
        }

        if (is_numeric($this->unavailable_after)) {
            $this->unavailable_after = intval($this->unavailable_after);
            if ($this->unavailable_after <= 0) {
                $this->unavailable_after = 2;
            }
        } else {
            $this->unavailable_after = false;
        }

        if (is_numeric($this->unavailable_before)) {
            $this->unavailable_before = intval($this->unavailable_before);
            if ($this->unavailable_before <= 0) {
                $this->unavailable_before = 2;
            }
        } else {
            $this->unavailable_before = false;
        }

        if (!is_bool($this->unavailable_display)) {
            $this->unavailable_display = false;
        }
    }
693423
def is_valid(self, qstr=None):
        """"""
        if qstr is None:
            qstr = self.currentText()
        return osp.isdir(to_text_string(qstr))
1016496
def form_valid(self, form):
        """"""
        auth_login(self.request, form.get_user())
        return HttpResponseRedirect(self.get_success_url())
676584
function (page) {
            var state = this.state;
            if (state.currentPage !== page) {
                // page has changed
                state.currentPage = page;
                this.updateVisiblePages();
                scope.broadcast('pagefocus', {
                    page: state.currentPage,
                    numPages: this.numPages,
                    visiblePages: util.extend([], state.visiblePages),
                    fullyVisiblePages: util.extend([], state.fullyVisiblePages)
                });
            } else {
                // still update visible pages!
                this.updateVisiblePages();
            }
        }
992369
public function valid()
    {
		if ($this->dontUsePaging || !$this->itemCountPerPage)
		{		
			return $this->position >= 0 && $this->position < count($this->getElements());
		}
		if ($this->position < 0) return false;
		if ($this->itemCountPerPage && $this->position >= $this->itemCountPerPage) return false;
		if ($this->getPosition() >= count($this->getElements())) return false;
		return true;
    }