function limpaTags($limpar) { if (is_array($limpar)) { $str = ''; for ($x = 0; $x < count($limpar); $x++) { $str .= $limpar[$x] != '' ? $limpar[$x] . ' ' : ''; } $str = strip_Tags(str_Replace(" ", ", ", subStr($str, 0, -1))); } return $str; }
/** * Функция добавляет в массив алертов новую запись * @param string $text Текст алерта * @return void */ function alert($text) { $this->result[alert][] = html_entity_decode(strip_Tags($text)); }
public function loginAction() { $loginForm = new Form_Login(); $resetForm = new Form_ResetPassword(); $request = $this->getRequest(); if ($request->isPost()) { $loginForm->isValid($request->getPost()); $adapter = new Kaltura_AdminAuthAdapter(); $adapter->setPrivileges('disableentitlement'); $safeEmailFieldValue = strip_Tags($request->getPost('email')); // Strip HTML Tags to prevent a potential XSS attack $passwordFieldValue = $request->getPost('password'); // DO NOT strip 'password' HTML Tags in order not to invalidate passwords (e.g. "<b>BoldPassword</b>") $adapter->setCredentials($safeEmailFieldValue, $passwordFieldValue); $loginForm->getElement('email')->setValue($safeEmailFieldValue); // Update the "safe" value onto the form $adapter->setTimezoneOffset($request->getPost('timezone_offset')); $auth = Infra_AuthHelper::getAuthInstance(); $result = $auth->authenticate($adapter); if ($result->isValid()) { if ($request->getPost('remember_me')) { Zend_Session::rememberMe(60 * 60 * 24 * 7); } // 1 week $nextUri = $this->_getParam('next_uri'); if ($nextUri) { $this->_helper->redirector->gotoUrl($nextUri); } else { $this->_helper->redirector('list', 'partner'); } } else { $loginForm->setDescription('login error'); } } $loginForm->setDefault('next_uri', $this->_getParam('next_uri')); // set in Infra_AuthPlugin $this->view->loginForm = $loginForm; $this->view->resetForm = $resetForm; $this->render('login'); }
function excerpt() { # Identify and sanitize excerpt: atom:summary, or rss:description $excerpt = $this->entry->get_description(); # Many RSS feeds use rss:description, inadvisably, to # carry the entire post (typically with escaped HTML). # If that's what happened, we don't want the full # content for the excerpt. $content = $this->content(); // Ignore whitespace, case, and tag cruft. $theExcerpt = preg_replace('/\\s+/', '', strtolower(strip_tags($excerpt))); $theContent = preg_replace('/\\s+/', '', strtolower(strip_Tags($content))); if (empty($excerpt) or $theExcerpt == $theContent) { # If content is available, generate an excerpt. if (strlen(trim($content)) > 0) { $excerpt = strip_tags($content); if (strlen($excerpt) > 255) { $excerpt = substr($excerpt, 0, 252) . '...'; } } } return $excerpt; }