/** * Display navigation to next/previous set of posts when applicable. * * @since Farmtoyou 1.0 * * @global WP_Query $wp_query WordPress Query object. * @global WP_Rewrite $wp_rewrite WordPress Rewrite object. */ function farmtoyou_paging_nav() { global $wp_query, $wp_rewrite; // Don't print empty markup if there's only one page. if ($wp_query->max_num_pages < 2) { return; } $paged = get_query_var('paged') ? intval(get_query_var('paged')) : 1; $pagenum_link = html_entity_decode(get_pagenum_link()); $query_args = array(); $url_parts = explode('?', $pagenum_link); if (isset($url_parts[1])) { wp_parse_str($url_parts[1], $query_args); } $pagenum_link = remove_query_arg(array_keys($query_args), $pagenum_link); $pagenum_link = trailingslashit($pagenum_link) . '%_%'; $format = $wp_rewrite->using_index_permalinks() && !strpos($pagenum_link, 'index.php') ? 'index.php/' : ''; $format .= $wp_rewrite->using_permalinks() ? user_trailingslashit($wp_rewrite->pagination_base . '/%#%', 'paged') : '?paged=%#%'; // Set up paginated links. $links = paginate_links(array('base' => $pagenum_link, 'format' => $format, 'total' => $wp_query->max_num_pages, 'current' => $paged, 'mid_size' => 1, 'add_args' => array_map('urlencode', $query_args), 'prev_text' => __('← Previous', 'farmtoyou'), 'next_text' => __('Next →', 'farmtoyou'))); if ($links) { ?> <nav class="navigation paging-navigation" role="navigation"> <div class="pagination loop-pagination"> <?php echo $links; ?> </div><!-- .pagination --> </nav><!-- .navigation --> <?php } }
public function sendBatchMail() { $json = array(); $store = $this->model_settings_stores->getStore(isset($this->request->post['store_id']) ? (int) $this->request->post['store_id'] : 0); $page = 1; if (isset($this->request->get['page'])) { $page = (int) $this->request->get['page']; } $this->request->post['start'] = ($page - 1) * 10; $this->request->post['limit'] = 10; $emails = $this->getData(); if (count($emails)) { $json['next'] = str_replace('&', '&', $this->url->link('app/newsletterbasic/sendbatchmail', 'token=' . $this->session->data['token'] . '&page=' . ($page + 1), 'SSL')); $json['success'] = Sumo\Language::getVar('APP_NEWSLETTERBASIC_BATCH_EMAILS_SENT', $page); $mail = $this->request->post['mail']; foreach ($emails as $data) { $language = $this->config->get('language_id'); if (isset($data['language_id']) && !empty($data['language_id'])) { $language = (int) $data['language_id']; } $data['name'] = $store['name']; $data['url'] = 'http://' . rtrim($store['base_http'], '/') . '/'; $this->sendMail($data, $mail[$language]['subject'], html_entity_decode($mail[$language]['message']) . '<!-- Email send with SumoStore, leading E-commerce software -->'); } } else { $json['next'] = ''; $json['success'] = Sumo\Language::getVar('APP_NEWSLETTERBASIC_ALL_EMAILS_SENT'); } $json['debug'] = $this->request->post; $json['debug_get'] = $this->request->get; $this->response->setOutput(json_encode($json)); }
public function display() { //Set the document link $this->_document->link = $this->createRoute('format=html&view=posts&blog_blog_id=' . KRequest::get('get.id', 'int')); //Get the list of posts $posts = KFactory::get($this->getModel())->getList(); foreach ($posts as $post) { // strip html from feed item title $title = html_entity_decode($post->title); // url link to article $link = $this->createRoute('format=html&view=post&slug=' . $post->slug); // generate the description as a hcard $description = $post->text; // load individual item creator class $item = new JFeedItem(); $item->title = $title; $item->link = $link; $item->description = $description; $item->date = date('r', strtotime($post->created_on)); $item->category = ''; // loads item info into rss array $doc =& JFactory::getDocument(); $doc->addItem($item); } return $this; }
protected function index() { $this->load_language('common/footer'); $this->data['google_analytics'] = html_entity_decode($this->config->get('config_google_analytics'), ENT_QUOTES, 'UTF-8'); $this->load->model('catalog/information'); $this->data['informations'] = array(); foreach ($this->model_catalog_information->getInformations() as $result) { $this->data['informations'][] = array('title' => $result['title'], 'href' => $this->url->link('information/information', 'information_id=' . $result['information_id'])); } $this->data['contact'] = $this->url->link('information/contact'); $this->data['return'] = $this->url->link('account/return/insert', '', 'SSL'); $this->data['sitemap'] = $this->url->link('information/sitemap'); $this->data['manufacturer'] = $this->url->link('product/manufacturer', '', 'SSL'); $this->data['voucher'] = $this->url->link('checkout/voucher', '', 'SSL'); $this->data['affiliate'] = $this->url->link('affiliate/account', '', 'SSL'); $this->data['special'] = $this->url->link('product/special'); $this->data['account'] = $this->url->link('account/account', '', 'SSL'); $this->data['order'] = $this->url->link('account/order', '', 'SSL'); $this->data['wishlist'] = $this->url->link('account/wishlist', '', 'SSL'); $this->data['newsletter'] = $this->url->link('account/newsletter', '', 'SSL'); $this->data['powered'] = sprintf($this->language->get('text_powered'), $this->config->get('config_name'), date('Y', time())); if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/common/footer.tpl')) { $this->template = $this->config->get('config_template') . '/template/common/footer.tpl'; } else { $this->template = 'default/template/common/footer.tpl'; } $this->render(); }
/** * Constructor function. Arguments: * $params - An assoc array of parameters: * * host - The hostname of the smtp server Default: localhost * port - The port the smtp server runs on Default: 25 * helo - What to send as the HELO command Default: localhost * (typically the hostname of the * machine this script runs on) * auth - Whether to use basic authentication Default: FALSE * user - Username for authentication Default: <blank> * pass - Password for authentication Default: <blank> * timeout - The timeout in seconds for the call Default: 5 * to fsockopen() */ function smtp($params = array()) { if (!defined('CRLF')) { define('CRLF', "\r\n", TRUE); } $this->authenticated = FALSE; $this->timeout = 5; $this->status = SMTP_STATUS_NOT_CONNECTED; if (!empty($GLOBALS['HTTP_SERVER_VARS']['HTTP_HOST'])) { $helo = $GLOBALS['HTTP_SERVER_VARS']['HTTP_HOST']; } elseif (!empty($GLOBALS['HTTP_SERVER_VARS']['SERVER_NAME'])) { $helo = $GLOBALS['HTTP_SERVER_VARS']['SERVER_NAME']; } else { $helo = 'localhost'; } $this->host = $_SESSION['SMTPSettings']['host']; $this->port = $_SESSION['SMTPSettings']['port']; $this->helo = $_SESSION['SMTPSettings']['heloaddress']; $this->auth = $_SESSION['SMTPSettings']['auth']; $this->user = html_entity_decode($_SESSION['SMTPSettings']['username']); $this->pass = html_entity_decode($_SESSION['SMTPSettings']['password']); $this->errors = array(); foreach ($params as $key => $value) { $this->{$key} = $value; } }
function swp_buffer_button_html($array) { // If we've already generated this button, just use our existing html if (isset($_GLOBALS['sw']['buttons'][$array['postID']]['buffer'])) { $array['resource']['buffer'] = $_GLOBALS['sw']['buttons'][$array['postID']]['buffer']; // If not, let's check if Buffer is activated and create the button HTML } elseif (isset($array['options']['newOrderOfIcons']['buffer']) && !isset($array['buttons']) || isset($array['buttons']) && isset($array['buttons']['buffer'])) { // Collect the Title $title = get_post_meta($array['postID'], 'nc_ogTitle', true); if (!$title) { $title = get_the_title(); } $array['totes'] += $array['shares']['buffer']; ++$array['count']; $array['resource']['buffer'] = '<div class="nc_tweetContainer swp_buffer" data-id="' . $array['count'] . '" data-network="buffer">'; $link = urlencode(urldecode(swp_process_url($array['url'], 'buffer', $array['postID']))); $array['resource']['buffer'] .= '<a target="_blank" href="http://bufferapp.com/add?url=' . $link . '&text=' . urlencode(html_entity_decode($title, ENT_COMPAT, 'UTF-8')) . '" data-link="http://bufferapp.com/add?url=' . $link . '&text=' . urlencode(html_entity_decode($title, ENT_COMPAT, 'UTF-8')) . '" class="nc_tweet buffer_link">'; if ($array['options']['totesEach'] && $array['shares']['totes'] >= $array['options']['minTotes'] && $array['shares']['buffer'] > 0) { $array['resource']['buffer'] .= '<span class="iconFiller">'; $array['resource']['buffer'] .= '<span class="spaceManWilly">'; $array['resource']['buffer'] .= '<i class="sw sw-buffer"></i>'; $array['resource']['buffer'] .= '<span class="swp_share"> ' . __('Buffer', 'social-warfare') . '</span>'; $array['resource']['buffer'] .= '</span></span>'; $array['resource']['buffer'] .= '<span class="swp_count">' . swp_kilomega($array['shares']['buffer']) . '</span>'; } else { $array['resource']['buffer'] .= '<span class="swp_count swp_hide"><span class="iconFiller"><span class="spaceManWilly"><i class="sw sw-buffer"></i><span class="swp_share"> ' . __('Buffer', 'social-warfare') . '</span></span></span></span>'; } $array['resource']['buffer'] .= '</a>'; $array['resource']['buffer'] .= '</div>'; // Store these buttons so that we don't have to generate them for each set $_GLOBALS['sw']['buttons'][$array['postID']]['buffer'] = $array['resource']['buffer']; } return $array; }
public static function createDistantNoticeLang($version_notice_id, $notice_id, $notice_ref, $lang, Doctrine_Connection $conn = null) { if ($conn == null) { $conn = Doctrine_Manager::connection(); } try { $conn->beginTransaction(); //Début de la transaction //Appel du webservice $result_service = MyFunction::loadResultOfWebServiceByPostJson(MyFunction::getPrefixPath(null) . "serviceweb/createNoticeVersion.json", array('version_notice_id' => $version_notice_id, 'notice_id' => $notice_id, 'notice_ref' => $notice_ref, 'lang' => $lang)); //Récupération de la nouvelle langue de notice pour traitement $array_result = json_decode(html_entity_decode($result_service), true); if (count($array_result) == 0) { return array("success" => false, "message" => "Error on transaction"); } if (array_key_exists("error", $array_result)) { return array("success" => false, "message" => $array_result["error"]); } if (!$array_result[0]) { return array("success" => false, "message" => "Empty result content"); } self::reload($array_result, $conn); $conn->commit(); return Doctrine_Core::getTable("EiVersionNotice")->findOneByVersionNoticeIdAndNoticeIdAndNoticeRefAndLang($version_notice_id, $notice_id, $notice_ref, $lang); } catch (Exception $e) { $conn->rollback(); throw $e; return false; } }
/** * Here we do the work */ public function execute($comment) { global $_CONF, $_TABLES, $_USER, $LANG_SX00; if (isset($_USER['uid']) && $_USER['uid'] > 1) { $uid = $_USER['uid']; } else { $uid = 1; } /** * Include Blacklist Data */ $result = DB_query("SELECT value FROM {$_TABLES['spamx']} WHERE name='Personal'", 1); $nrows = DB_numRows($result); // named entities $comment = html_entity_decode($comment); // decimal notation $comment = preg_replace_callback('/&#(\\d+);/m', array($this, 'callbackDecimal'), $comment); // hex notation $comment = preg_replace_callback('/&#x([a-f0-9]+);/mi', array($this, 'callbackHex'), $comment); $ans = 0; for ($i = 1; $i <= $nrows; $i++) { list($val) = DB_fetchArray($result); $val = str_replace('#', '\\#', $val); if (preg_match("#{$val}#i", $comment)) { $ans = 1; // quit on first positive match SPAMX_log($LANG_SX00['foundspam'] . $val . $LANG_SX00['foundspam2'] . $uid . $LANG_SX00['foundspam3'] . $_SERVER['REMOTE_ADDR']); break; } } return $ans; }
public function to_money($number, $do_encode = false) { if (!is_numeric($number)) { $number = $this->to_number($number); } if ($number === false) { return ''; } $negative = ''; if (strpos(strval($number), '-') !== false) { $negative = '-'; $number = floatval(substr($number, 1)); } $money = number_format($number, $this->currency['decimals'], $this->currency['decimal_separator'], $this->currency['thousand_separator']); if ($money == '0.00') { $negative = ''; } $symbol_left = !empty($this->currency['symbol_left']) ? $this->currency['symbol_left'] . $this->currency['symbol_padding'] : ''; $symbol_right = !empty($this->currency['symbol_right']) ? $this->currency['symbol_padding'] . $this->currency['symbol_right'] : ''; if ($do_encode) { $symbol_left = html_entity_decode($symbol_left); $symbol_right = html_entity_decode($symbol_right); } return $negative . $symbol_left . $money . $symbol_right; }
public static function showFields($mb) { $adminTemplatesFolderLocation = dirname(__FILE__) . '/admin_views/'; Mustache_Autoloader::register(); $template = new Mustache_Engine(array('loader' => new Mustache_Loader_FilesystemLoader($adminTemplatesFolderLocation), 'partials_loader' => new Mustache_Loader_FilesystemLoader($adminTemplatesFolderLocation))); $fields = $mb->fields; foreach ($fields as $field) { if (empty($field['name']) || empty($field['fieldType']) || empty($field['labelTitle'])) { continue; } $mb->the_field($field['name']); if ($field['fieldType'] == 'textarea') { wp_editor(html_entity_decode($mb->get_the_value()), $mb->get_the_name(), array('wpautop' => true, 'media_buttons' => false, 'textarea_rows' => get_option('default_post_edit_rows', 10), 'tabindex' => '', 'editor_css' => '', 'editor_class' => '', 'teeny' => true, 'dfw' => false, 'tinymce' => false, 'quicktags' => true)); } else { switch ($field['fieldType']) { case 'imageUploader': $fieldHtml = self::getImageUploaderHtml($mb, $template); break; default: $fieldHtml = $template->render('text_field', array('theValue' => $mb->get_the_value(), 'theName' => $mb->get_the_name())); } echo $template->render('field_container', array('labelText' => $field['labelTitle'], 'fieldHTML' => $fieldHtml)); } } }
/** * Return filtered value * Removes potential XSS code from the input string. * * Using an external class by Travis Puderbaugh <*****@*****.**> * * @param string $value Unfiltered value * @return string The filtered value */ public function filter($value) { $value = stripslashes($value); $value = html_entity_decode($value, ENT_QUOTES); $filteredValue = \TYPO3\CMS\Core\Utility\GeneralUtility::removeXSS($value); return $filteredValue; }
public function loadConfig() { $this->installed = html_entity_decode(Configuration::get('DJL_INSTALLED'), ENT_COMPAT, 'UTF-8'); $this->useSSL = (int) html_entity_decode(Configuration::get('DJL_USE_SSL'), ENT_COMPAT, 'UTF-8'); $this->serviceURL = html_entity_decode(Configuration::get('DJL_SERVICE_URL'), ENT_COMPAT, 'UTF-8'); $this->sandboxServiceURL = html_entity_decode(Configuration::get('DJL_SANDBOX_SERVICE_URL'), ENT_COMPAT, 'UTF-8'); $this->mode = html_entity_decode(Configuration::get('DJL_MODE'), ENT_COMPAT, 'UTF-8'); $this->login = html_entity_decode(Configuration::get('DJL_LOGIN'), ENT_COMPAT, 'UTF-8'); $this->password = html_entity_decode(Configuration::get('DJL_PASSWORD'), ENT_COMPAT, 'UTF-8'); $this->trigerringStatuses = html_entity_decode(Configuration::get('DJL_TRIGERRING_STATUSES'), ENT_COMPAT, 'UTF-8'); $this->shippingPrefix = html_entity_decode(Configuration::get('DJL_SHIPPING_PREFIX'), ENT_COMPAT, 'UTF-8'); $this->country = html_entity_decode(Configuration::get('DJL_COUNTRY'), ENT_COMPAT, 'UTF-8'); if (strlen($this->country) == 0) { $this->country = 'fr'; } $this->visibility_status = html_entity_decode(Configuration::get('DJL_VISIBILITY_STATUS'), ENT_COMPAT, 'UTF-8'); $this->visible_users_list = html_entity_decode(Configuration::get('DJL_VISIBLE_USERS_LIST'), ENT_COMPAT, 'UTF-8'); $this->internal_version = Configuration::get('DJL_VERSION'); // Backward compatibility $activeVal = html_entity_decode(Configuration::get('DJL_ACTIVE'), ENT_COMPAT, 'UTF-8'); if ($activeVal != "") { $this->active = (int) $activeVal; $this->visibility_status = $this->active == 0 ? "invisible" : "visible"; } if ($this->visibility_status == "") { $this->visibility_status = "invisible"; } }
function generateJSON($auth_key, $guid, $year, $filename) { // Get json from API $url = "http://api.quito.junar.com/datastreams/invoke/" . $guid . "?auth_key=" . $auth_key . "&output=json_array"; $str = file_get_contents($url); $json = json_decode($str, true); // Array of Zonales id $zonales_id = array(1 => "Calderón", 2 => "Eloy Alfaro", 3 => "Eugenio Espejo", 4 => "La Delicia", 5 => "Los Chillos", 6 => "Manuela Saenz", 7 => "Quitumbe", 8 => "Tumbaco", 12 => "Sur", 13 => "Norte", 16 => "Centro"); $datos = array(); // Reading JSON and verify foreach ($json['result'] as $data) { $id_zonal = 0; $zonal = reset($zonales_id); // Checks if json contains a valid zonal and returns id while ($zonal = current($zonales_id)) { if (strpos($zonal, $data[1]) !== false) { $id_zonal = key($zonales_id); break; } next($zonales_id); } // Assings data according to id if ($id_zonal > 0) { if ($id_zonal > 10) { $id_zonal = $id_zonal - 10; } $datos[] = array("id" => $id_zonal, "zonal" => html_entity_decode($zonales_id[$id_zonal]), "periodo" => 2014, "dato" => intval($data[14])); } } // Write json file_put_contents($filename, json_encode($datos)); }
/** * Register the article's metadata with the SWORD deposit. */ function setMetadata() { $this->package->setCustodian($this->journal->getSetting('contactName')); $this->package->setTitle(html_entity_decode($this->article->getTitle($this->journal->getPrimaryLocale()), ENT_QUOTES, 'UTF-8')); $this->package->setAbstract(html_entity_decode(strip_tags($this->article->getAbstract($this->journal->getPrimaryLocale())), ENT_QUOTES, 'UTF-8')); $this->package->setType($this->section->getIdentifyType($this->journal->getPrimaryLocale())); // The article can be published or not. Support either. if (is_a($this->article, 'PublishedArticle')) { $doi = $this->article->getPubId('doi'); if ($doi !== null) { $this->package->setIdentifier($doi); } } foreach ($this->article->getAuthors() as $author) { $creator = $author->getFullName(true); $affiliation = $author->getAffiliation($this->journal->getPrimaryLocale()); if (!empty($affiliation)) { $creator .= "; {$affiliation}"; } $this->package->addCreator($creator); } // The article can be published or not. Support either. if (is_a($this->article, 'PublishedArticle')) { $plugin =& PluginRegistry::loadPlugin('citationFormats', 'bibtex'); $this->package->setCitation(html_entity_decode(strip_tags($plugin->fetchCitation($this->article, $this->issue, $this->journal)), ENT_QUOTES, 'UTF-8')); } }
function diaspora2bb($s) { $s = html_entity_decode($s, ENT_COMPAT, 'UTF-8'); // Remove CR to avoid problems with following code $s = str_replace("\r", "", $s); $s = str_replace("\n", " \n", $s); // The parser cannot handle paragraphs correctly $s = str_replace(array("</p>", "<p>", '<p dir="ltr">'), array("<br>", "<br>", "<br>"), $s); // Escaping the hash tags $s = preg_replace('/\\#([^\\s\\#])/', '#$1', $s); $s = Markdown($s); $s = preg_replace('/\\@\\{(.+?)\\; (.+?)\\@(.+?)\\}/', '@[url=https://$3/u/$2]$1[/url]', $s); $s = str_replace('#', '#', $s); $s = html2bbcode($s); // protect the recycle symbol from turning into a tag, but without unescaping angles and naked ampersands $s = str_replace('♲', html_entity_decode('♲', ENT_QUOTES, 'UTF-8'), $s); // Convert everything that looks like a link to a link $s = preg_replace("/([^\\]\\=]|^)(https?\\:\\/\\/)([a-zA-Z0-9\\:\\/\\-\\?\\&\\;\\.\\=\\_\\~\\#\\%\$\\!\\+\\,]+)/ism", '$1[url=$2$3]$2$3[/url]', $s); //$s = preg_replace("/([^\]\=]|^)(https?\:\/\/)(vimeo|youtu|www\.youtube|soundcloud)([a-zA-Z0-9\:\/\-\?\&\;\.\=\_\~\#\%\$\!\+\,]+)/ism", '$1[url=$2$3$4]$2$3$4[/url]',$s); $s = bb_tag_preg_replace("/\\[url\\=?(.*?)\\]https?:\\/\\/www.youtube.com\\/watch\\?v\\=(.*?)\\[\\/url\\]/ism", '[youtube]$2[/youtube]', 'url', $s); $s = bb_tag_preg_replace("/\\[url\\=https?:\\/\\/www.youtube.com\\/watch\\?v\\=(.*?)\\].*?\\[\\/url\\]/ism", '[youtube]$1[/youtube]', 'url', $s); $s = bb_tag_preg_replace("/\\[url\\=?(.*?)\\]https?:\\/\\/vimeo.com\\/([0-9]+)(.*?)\\[\\/url\\]/ism", '[vimeo]$2[/vimeo]', 'url', $s); $s = bb_tag_preg_replace("/\\[url\\=https?:\\/\\/vimeo.com\\/([0-9]+)\\](.*?)\\[\\/url\\]/ism", '[vimeo]$1[/vimeo]', 'url', $s); // remove duplicate adjacent code tags $s = preg_replace("/(\\[code\\])+(.*?)(\\[\\/code\\])+/ism", "[code]\$2[/code]", $s); // Don't show link to full picture (until it is fixed) $s = scale_external_images($s, false); return $s; }
/** * This method replaces the criteria element with the new format * @param $table * @param $rows * @param $target_column */ protected function updateTableWithNewJSON($table, $rows, $target_column) { global $db; foreach ($rows as $row) { $id_row = $row['id']; $json = json_decode(html_entity_decode($row[$target_column]), true); $newJSON = array(); foreach ($json as $item) { if ($item['expType'] != "MODULE") { array_push($newJSON, $item); continue; } $related = $this->getRelationshipByProjectID($row["prj_id"], $item['expModule']); // If the relation was not found log and mark PD to be disabled if ($related === null) { $this->log("Relation " . $item['expModule'] . " doesn't exists anymore, it will be removed."); $this->processesToDisable[$row["prj_id"]] = true; continue; } if (!$related || $related === $item['expModule']) { array_push($newJSON, $item); continue; } $item['expModule'] = $related; array_push($newJSON, $item); } $json = json_encode($newJSON); $updateSQL = "UPDATE {$table} SET {$target_column} = '{$json}' WHERE id = '{$id_row}'"; $db->query($updateSQL); } }
/** * HTML-decodes static text. * This method overrides parent implementation. * @param mixed object to be added as body content */ public function addParsedObject($object) { if (is_string($object)) { $object = html_entity_decode($object, ENT_QUOTES, 'UTF-8'); } parent::addParsedObject($object); }
protected function index($setting) { $this->load->model('bossblog/article'); if (file_exists('catalog/view/theme/' . $this->config->get('config_template') . '/stylesheet/bossthemes/bossblog.css')) { $this->document->addStyle('catalog/view/theme/' . $this->config->get('config_template') . '/stylesheet/bossthemes/bossblog.css'); } else { $this->document->addStyle('catalog/view/theme/default/stylesheet/bossthemes/bossblog.css'); } $results = array(); $results_data = $this->model_bossblog_article->getRecentCommentArticles($setting['limit']); $this->data['heading_title'] = $setting['title'][$this->config->get('config_language_id')]; $this->data['articles'] = array(); foreach ($results_data as $data) { $author = $data['author']; $comment = mb_substr(strip_tags(html_entity_decode($data['text'], ENT_QUOTES, 'UTF-8')), 0, 50) . '...'; $date_added = $data['date_added']; $result = $this->model_bossblog_article->getArticle($data['blog_article_id']); $this->data['articles'][] = array('blog_article_id' => $result['blog_article_id'], 'name' => $result['name'], 'author' => $author, 'comment' => $comment, 'date_added' => $date_added, 'href' => $this->url->link('bossblog/article', 'blog_article_id=' . $result['blog_article_id'])); } $this->data['template'] = $this->config->get('config_template'); if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/module/blogrecentcomment.tpl')) { $this->template = $this->config->get('config_template') . '/template/module/blogrecentcomment.tpl'; } else { $this->template = 'default/template/module/blogrecentcomment.tpl'; } $this->render(); }
public function visit(\DOMAttr $att, Compiler $context) { $node = $att->ownerElement; $pi = $context->createControlNode("set __tmp_omit = " . html_entity_decode($att->value)); $node->parentNode->insertBefore($pi, $node); $pi = $context->createControlNode("if not __tmp_omit"); $node->parentNode->insertBefore($pi, $node); $pi = $context->createControlNode("endif"); if ($node->firstChild) { $node->insertBefore($pi, $node->firstChild); } else { $node->appendChild($pi); } $pi = $context->createControlNode("if not __tmp_omit"); $node->appendChild($pi); $pi = $context->createControlNode("endif"); if ($node->parentNode->nextSibling) { $node->parentNode->insertBefore($pi, $node->parentNode->nextSibling); } else { $node->parentNode->appendChild($pi); } $node->removeAttributeNode($att); if ($att->value == "true" || $att->value == "1") { foreach (iterator_to_array($node->attributes) as $att) { $node->removeAttributeNode($att); } } return Attribute::STOP_ATTRIBUTE; }
private function getProducts($results, $setting) { $products = array(); $themeConfig = $this->config->get('themecontrol'); $this->load->language('module/themecontrol'); $this->load->model('catalog/product'); $this->load->model('tool/image'); foreach ($results as $result) { if ($result['image']) { $image = $this->model_tool_image->resize($result['image'], $setting['image_width'], $setting['image_height']); // Image Attribute for product } else { $image = false; } if ($this->config->get('config_customer_price') && $this->customer->isLogged() || !$this->config->get('config_customer_price')) { $price = $this->currency->format($this->tax->calculate($result['price'], $result['tax_class_id'], $this->config->get('config_tax'))); } else { $price = false; } if ((double) $result['special']) { $special = $this->currency->format($this->tax->calculate($result['special'], $result['tax_class_id'], $this->config->get('config_tax'))); } else { $special = false; } if ($this->config->get('config_review_status')) { $rating = $result['rating']; } else { $rating = false; } $products[] = array('product_id' => $result['product_id'], 'thumb' => $image, 'name' => $result['name'], 'price' => $price, 'special' => $special, 'rating' => $rating, 'description' => html_entity_decode($result['description'], ENT_QUOTES, 'UTF-8'), 'reviews' => sprintf($this->language->get('text_reviews'), (int) $result['reviews']), 'href' => $this->url->link('product/product', 'product_id=' . $result['product_id']), 'thumb2' => isset($thumb2) ? $thumb2 : ''); } return $products; }
protected function index() { $this->data['button_confirm'] = $this->language->get('button_confirm'); if (!$this->config->get('paymate_test')) { $this->data['action'] = 'https://www.paymate.com/PayMate/ExpressPayment'; } else { $this->data['action'] = 'https://www.paymate.com.au/PayMate/TestExpressPayment'; } $this->load->model('checkout/order'); $order_info = $this->model_checkout_order->getOrder($this->session->data['order_id']); $this->data['mid'] = $this->config->get('paymate_username'); $this->data['amt'] = $this->currency->format($order_info['total'], $order_info['currency_code'], $order_info['currency_value'], false); $this->data['currency'] = $order_info['currency_code']; $this->data['ref'] = $order_info['order_id']; $this->data['pmt_sender_email'] = $order_info['email']; $this->data['pmt_contact_firstname'] = html_entity_decode($order_info['payment_firstname'], ENT_QUOTES, 'UTF-8'); $this->data['pmt_contact_surname'] = html_entity_decode($order_info['payment_lastname'], ENT_QUOTES, 'UTF-8'); $this->data['pmt_contact_phone'] = $order_info['telephone']; $this->data['pmt_country'] = $order_info['payment_iso_code_2']; $this->data['regindi_address1'] = html_entity_decode($order_info['payment_address_1'], ENT_QUOTES, 'UTF-8'); $this->data['regindi_address2'] = html_entity_decode($order_info['payment_address_2'], ENT_QUOTES, 'UTF-8'); $this->data['regindi_sub'] = html_entity_decode($order_info['payment_city'], ENT_QUOTES, 'UTF-8'); $this->data['regindi_state'] = html_entity_decode($order_info['payment_zone'], ENT_QUOTES, 'UTF-8'); $this->data['regindi_pcode'] = html_entity_decode($order_info['payment_postcode'], ENT_QUOTES, 'UTF-8'); $this->data['return'] = $this->url->link('payment/paymate/callback', 'hash=' . md5($order_info['order_id'] . $this->currency->format($order_info['total'], $order_info['currency_code'], $order_info['currency_value'], false) . $order_info['currency_code'] . $this->config->get('paymate_password'))); if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/payment/paymate.tpl')) { $this->template = $this->config->get('config_template') . '/template/payment/paymate.tpl'; } else { $this->template = 'default/template/payment/paymate.tpl'; } $this->render(); }
/** * Display navigation to next/previous set of posts when applicable. * * @return void */ function my_simone_paging_nav() { // Don't print empty markup if there's only one page. if ($GLOBALS['wp_query']->max_num_pages < 2) { return; } $paged = get_query_var('paged') ? intval(get_query_var('paged')) : 1; $pagenum_link = html_entity_decode(get_pagenum_link()); $query_args = array(); $url_parts = explode('?', $pagenum_link); if (isset($url_parts[1])) { wp_parse_str($url_parts[1], $query_args); } $pagenum_link = remove_query_arg(array_keys($query_args), $pagenum_link); $pagenum_link = trailingslashit($pagenum_link) . '%_%'; $format = $GLOBALS['wp_rewrite']->using_index_permalinks() && !strpos($pagenum_link, 'index.php') ? 'index.php/' : ''; $format .= $GLOBALS['wp_rewrite']->using_permalinks() ? user_trailingslashit('page/%#%', 'paged') : '?paged=%#%'; // Set up paginated links. $links = paginate_links(array('base' => $pagenum_link, 'format' => $format, 'total' => $GLOBALS['wp_query']->max_num_pages, 'current' => $paged, 'mid_size' => 2, 'add_args' => array_map('urlencode', $query_args), 'prev_text' => __('← Previous', 'my-simone'), 'next_text' => __('Next →', 'my-simone'), 'type' => 'list')); if ($links) { ?> <nav class="navigation paging-navigation" role="navigation"> <h1 class="screen-reader-text"><?php _e('Posts navigation', 'my-simone'); ?> </h1> <?php echo $links; ?> </nav><!-- .navigation --> <?php } }
/** * Refresh the parameters passed to the JavaScript via JSON. * * @since 3.4.0 * @since 4.2.0 Moved from WP_Customize_Upload_Control. * * @see WP_Customize_Control::to_json() */ public function to_json() { parent::to_json(); $this->json['label'] = html_entity_decode($this->label, ENT_QUOTES, get_bloginfo('charset')); $this->json['mime_type'] = $this->mime_type; $this->json['button_labels'] = $this->button_labels; $this->json['canUpload'] = current_user_can('upload_files'); $value = $this->value(); if (is_object($this->setting)) { if ($this->setting->default) { // Fake an attachment model - needs all fields used by template. // Note that the default value must be a URL, NOT an attachment ID. $type = in_array(substr($this->setting->default, -3), array('jpg', 'png', 'gif', 'bmp')) ? 'image' : 'document'; $default_attachment = array('id' => 1, 'url' => $this->setting->default, 'type' => $type, 'icon' => wp_mime_type_icon($type), 'title' => basename($this->setting->default)); if ('image' === $type) { $default_attachment['sizes'] = array('full' => array('url' => $this->setting->default)); } $this->json['defaultAttachment'] = $default_attachment; } if ($value && $this->setting->default && $value === $this->setting->default) { // Set the default as the attachment. $this->json['attachment'] = $this->json['defaultAttachment']; } elseif ($value) { $this->json['attachment'] = wp_prepare_attachment_for_js($value); } } }
public function embed_player($skin = "", $username = "", $tape = "") { if (!$this->ion_auth->username_check($username)) { $this->data['tape'] = NULL; $this->data['tape_status'] = "The embedded mixtape no longer exists."; } else { $this->data['username'] = $username; //cached DB call $user = $this->cache->model('User_model', 'get_user_info', array($username), 1800); //$user = $this->User_model->get_user_info($username); $sqlWhere = array('mixtapes.user_id' => $user->id, 'mixtapes.tape_url' => $tape); $tape = $this->cache->model('Mixtape_model', 'get_mixtapes', array($sqlWhere), 1800); if (!$tape) { $this->data['tape'] = NULL; $this->data['tape_status'] = "The embedded mixtape no longer exists."; } else { $tape = $tape[0]; $this->data['tape'] = $tape; $this->load->helper('status'); $this->data['tape_status'] = status_message('mixtape', $tape->status); $this->data['user'] = $user; $meta_description = $tape->tape_description === '' ? htmlspecialchars($tape->tape_title . ' mixtape, by ' . $tape->tape_artist, ENT_QUOTES) : htmlspecialchars($tape->tape_description, ENT_QUOTES); $this->data['meta_name'] = array('description' => html_entity_decode('Steam/Download ' . $meta_description), 'twitter:card' => 'player', 'twitter:domain' => base_url(), 'twitter:site' => $this->lang->line('meta_twitter'), 'twitter:title' => htmlspecialchars($tape->tape_artist . ' - ' . $tape->tape_title, ENT_QUOTES), 'twitter:description' => htmlspecialchars($meta_description, ENT_QUOTES), 'twitter:image' => tape_img($tape->username, $tape->tape_url, $tape->tape_image), 'twitter:player' => base_url('embed/mixtape/1/' . $username . '/' . $tape->tape_url), 'twitter:player:width' => '480', 'twitter:player:height' => '300', 'twitter:creator' => '@hiphopvip1'); $this->data['meta_prop'] = array('og:title' => htmlspecialchars('Listen and Download ' . $tape->tape_artist . ' - ' . $tape->tape_title, ENT_QUOTES), 'og:url' => base_url('mixtape/' . $username . '/' . $tape->tape_url), 'og:image' => tape_img($tape->username, $tape->tape_url, $tape->tape_image), 'og:site_name' => 'hiphopVIP', 'og:description' => htmlspecialchars($meta_description, ENT_QUOTES)); $this->data['playlist'] = $this->getPlaylistData($tape->id); $this->data['vendorCSS'] = array('apm/skin/hhvip.css', 'apm/skin/jquery-ui-slider.custom.css', 'social/social-likes_flat.css', 'forms.css'); $this->data['vendorJS'] = array('apm/lib/jquery-ui-slider-1.10.4.custom.min.js', 'apm/lib/modernizr-2.5.3-custom.min.js', 'apm/lib/soundmanager2-jsmin.js', 'apm/apmplayer.js', 'apm/apmplayer_ui.jquery.js', 'social-likes/social-likes.min.js'); } // song exists } //user exists $this->_render('mixtapes/embed_player', $renderData = 'EMBED', $this->data); }
private function _genericReplacements() { $this->_doc_content = strip_tags($this->_doc_content); $this->_doc_content = ltrim(rtrim($this->_doc_content)); $this->_doc_content = mb_strtolower($this->_doc_content, $this->_charset); // Remove dots between chars (for things like urls) $this->_doc_content = $this->_my_preg_replace("/([a-z]{1})[\\.]+([a-z]{1})/", "\$1\$2", $this->_doc_content); // ? Remove all html entities // $this->_doc_content = $this->_my_preg_replace("/&[#|a-z|0-9]+;/", " ", $this->_doc_content); // Decode all html entities $this->_doc_content = html_entity_decode($this->_doc_content, ENT_COMPAT, $this->_charset); // Replace multiple spaces chars with just one space $this->_doc_content = $this->_my_preg_replace("/[\\s|\t|\n|\r]+/", " ", $this->_doc_content); // Remove dots, dashes and spaces between digits $this->_doc_content = $this->_my_preg_replace("/([0-9]{1})[\\.|\\s|\\-]+([0-9]{1})/", "\$1\$2", $this->_doc_content); // Remove spaces after sentences and replace multiple dots with just one dot $this->_doc_content = $this->_my_preg_replace("/[\\.]+ /", ".", $this->_doc_content); // The same for sentences ending with question marks $this->_doc_content = $this->_my_preg_replace("/[\\?]+ /", ".", $this->_doc_content); // The same for "!" $this->_doc_content = $this->_my_preg_replace("/[\\!]+ /", ".", $this->_doc_content); // Remove all non-alphanumeric characters except for spaces and dots // $this->_doc_content = $this->_my_preg_replace("/[^a-z|а-я|^\.|^\d|^\s|^@]+/i", "", $this->_doc_content); return $this; }
public static function xssfilter($string) { if (is_array($string)) { return $string; } $string = str_replace(array("&", "<", ">"), array("&amp;", "&lt;", "&gt;"), $string); // fix &entitiy\n; $string = preg_replace('#(&\\#*\\w+)[\\x00-\\x20]+;#u', "\$1;", $string); $string = preg_replace('#(&\\#x*)([0-9A-F]+);*#iu', "\$1\$2;", $string); $string = html_entity_decode($string, ENT_COMPAT, "UTF-8"); // remove any attribute starting with "on" or xmlns $string = preg_replace('#(<[^>]+[\\x00-\\x20\\"\'])(on|xmlns)[^>]*>#iUu', "\$1>", $string); // remove javascript: and vbscript: protocol $string = preg_replace('#([a-z]*)[\\x00-\\x20]*=[\\x00-\\x20]*([\\`\'\\"]*)[\\x00-\\x20]*j[\\x00-\\x20]*a[\\x00-\\x20]*v[\\x00-\\x20]*a[\\x00-\\x20]*s[\\x00-\\x20]*c[\\x00-\\x20]*r[\\x00-\\x20]*i[\\x00-\\x20]*p[\\x00-\\x20]*t[\\x00-\\x20]*:#iUu', '$1=$2nojavascript...', $string); $string = preg_replace('#([a-z]*)[\\x00-\\x20]*=([\'\\"]*)[\\x00-\\x20]*v[\\x00-\\x20]*b[\\x00-\\x20]*s[\\x00-\\x20]*c[\\x00-\\x20]*r[\\x00-\\x20]*i[\\x00-\\x20]*p[\\x00-\\x20]*t[\\x00-\\x20]*:#iUu', '$1=$2novbscript...', $string); $string = preg_replace('#([a-z]*)[\\x00-\\x20]*=([\'\\"]*)[\\x00-\\x20]*-moz-binding[\\x00-\\x20]*:#Uu', '$1=$2nomozbinding...', $string); //<span style="width: expression(alert('Ping!'));"></span> // only works in ie... $string = preg_replace('#(<[^>]+)style[\\x00-\\x20]*=[\\x00-\\x20]*([\\`\'\\"]*).*expression[\\x00-\\x20]*\\([^>]*>#iU', "\$1>", $string); $string = preg_replace('#(<[^>]+)style[\\x00-\\x20]*=[\\x00-\\x20]*([\\`\'\\"]*).*behaviour[\\x00-\\x20]*\\([^>]*>#iU', "\$1>", $string); $string = preg_replace('#(<[^>]+)style[\\x00-\\x20]*=[\\x00-\\x20]*([\\`\'\\"]*).*s[\\x00-\\x20]*c[\\x00-\\x20]*r[\\x00-\\x20]*i[\\x00-\\x20]*p[\\x00-\\x20]*t[\\x00-\\x20]*:*[^>]*>#iUu', "\$1>", $string); //remove namespaced elements (we do not need them...) $string = preg_replace('#</*\\w+:\\w[^>]*>#i', "", $string); //remove really unwanted tags do { $oldstring = $string; $string = preg_replace('#</*(applet|meta|xml|blink|link|style|script|frame|form|input|select|button|textarea|frameset|ilayer|layer|bgsound|title|base)[^>]*>#i', "", $string); } while ($oldstring != $string); return $string; }
function getMessage($extension = '', $xml = '', $version = '', $addmargin = 0) { if (!$extension || !$xml && !$version) { return; } $alias = preg_replace('#[^a-z\\-]#', '', str_replace('?', '-', strtolower($extension))); if ($xml) { $xml = JApplicationHelper::parseXMLInstallFile(JPATH_SITE . DS . str_replace('/', DS, $xml)); if ($xml && isset($xml['version'])) { $version = $xml['version']; } } if (!$version) { return; } JHTML::_('behavior.mootools'); $document =& JFactory::getDocument(); $document->addScript(JURI::root(true) . '/plugins/system/nonumberelements/js/script.js?v=' . $this->_version); $url = 'http://www.nonumber.nl/ext/version.php?ext=' . $alias . '&version=' . $version; $script = "\n\t\t\twindow.addEvent( 'domready', function() {\n\t\t\t\tnnScripts.loadajax(\n\t\t\t\t\t'" . $url . "',\n\t\t\t\t\t'nnScripts.displayVersion( \\'" . $alias . "\\', data )',\n\t\t\t\t\t'nnScripts.displayVersion( \\'" . $alias . "\\', \\'\\' )'\n\t\t\t\t);\n\t\t\t});\n\t\t"; $document->addScriptDeclaration($script); $msg = html_entity_decode(JText::sprintf('NN_A_NEWER_VERSION_IS_AVAILABLE', 'http://www.nonumber.nl/' . $alias . '/download', '<span id="nonumber_newversionnumber_' . $alias . '"></span>', $version), ENT_COMPAT, 'UTF-8'); $margin = $addmargin ? '10px;' : '3px;'; $msg = '<div style="border:3px solid #F0DC7E;color:#CC0000;margin-bottom:' . $margin . '"><div style="padding: 2px 5px;background-color:#EFE7B8">' . $msg . '</div></div>'; $msg = '<div id="nonumber_version_' . $alias . '" style="display: none;">' . $msg . '</div>'; return $msg; }
protected function parse($st) { if (preg_match_all('#var placemark' . '.+?Point.(?<lon>[\\d\\.]+),(?<lat>[\\d\\.]+)' . '.+?<h3>(?<_addr>.+?)</h3>' . '.+?Телефон: (?<phone>.+?)<' . '.+?работы: (?<hours>.+?)<' . ".+?class=.card(?<ext>.+?)\t</div>" . "#su", $st, $m, PREG_SET_ORDER)) { foreach ($m as $obj) { $obj['_addr'] = html_entity_decode(strip_tags($obj['_addr'])); $obj['phone'] = strip_tags($this->phone($obj['phone'])); $obj['opening_hours'] = $this->time($obj['hours']); if (strpos($obj['ext'], 'visa.')) { $obj['payment:cards'] = 'yes'; } if (strpos($obj['ext'], 'fish.')) { $obj['aquarium'] = 'yes'; } if (strpos($obj['ext'], 'helf.')) { $obj['veterinary'] = 'yes'; } if (strpos($obj['ext'], 'slon.')) { $obj['pets'] = 'yes'; } if (strpos($obj['ext'], 'str.')) { $obj['grooming'] = 'yes'; } $this->addObject($this->makeObject($obj)); } } }
public function output(Pagemill_Data $data, Pagemill_Stream $stream) { //$inner = $data->parseVariables($this->rawOutput(), false); $tmp = new Pagemill_Stream(true); foreach ($this->children() as $child) { $child->process($data, $tmp); } $inner = html_entity_decode($tmp->peek(), ENT_COMPAT, 'UTF-8'); $data->set('value', $inner); $use = $data->parseVariables($this->getAttribute('use')); if ($use) { // Use the requested editor if available if (class_exists($use)) { if (is_subclass_of($use, __CLASS__)) { $sub = new $use($this->name(), $this->attributes(), $this, $this->docType()); $sub->output($data, $stream); return; } else { trigger_error("Requested editor class '{$cls}' does not appear to be an editor subclass."); } } else { trigger_error("Requested editor class '{$cls}' does not exist."); } } if (TYPEF_DEFAULT_EDITOR != '') { // Use the requested editor if available $use = TYPEF_DEFAULT_EDITOR; if (class_exists($use)) { if (is_subclass_of($use, __CLASS__)) { $sub = new $use($this->name(), $this->attributes(), $this, $this->docType()); $sub->output($data, $stream); return; } else { trigger_error("Configured editor class '{$use}' does not appear to be an editor subclass."); } } else { trigger_error("Configured editor class '{$use}' does not exist."); } } // Use CKEditor if available if (class_exists('Typeframe_Tag_Editor_CkEditor')) { $sub = new Typeframe_Tag_Editor_CkEditor($this->name(), $this->attributes(), $this, $this->docType()); $sub->process($data, $stream); return; } // No editor available. Use a plain textarea. $attribs = ''; foreach ($this->attributes() as $k => $v) { if ($k != 'use') { $attribs .= " {$k}=\"" . $data->parseVariables($v) . "\""; } } if (!$this->getAttribute('cols')) { $attribs .= ' cols="80"'; } if (!$this->getAttribute('rows')) { $attribs .= ' rows="25"'; } $stream->puts("<textarea{$attribs}>" . $inner . "</textarea>"); }
protected function validate() { if (!isset($this->request->post['username']) || !isset($this->request->post['password']) || !$this->user->login($this->request->post['username'], html_entity_decode($this->request->post['password'], ENT_QUOTES, 'UTF-8'))) { $this->error['warning'] = $this->language->get('error_login'); } return !$this->error; }