$protocol = 'https'; } header('Location: ' . $protocol . '://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['SCRIPT_NAME'])); exit; } // Send headers $http = new PMF_Helper_Http(); $http->setContentType('application/json'); $http->addHeader(); $oTag = new PMF_Tags($faqConfig); $autoCompleteValue = PMF_Filter::filterInput(INPUT_GET, 'q', FILTER_SANITIZE_STRIPPED); if (!is_null($autoCompleteValue)) { if (strpos($autoCompleteValue, ',')) { $arrayOfValues = explode(',', $autoCompleteValue); $autoCompleteValue = end($arrayOfValues); } $tags = $oTag->getAllTags(strtolower($autoCompleteValue), PMF_TAGS_CLOUD_RESULT_SET_SIZE, true); } else { $tags = $oTag->getAllTags(); } if ($permission['editbt']) { $i = 0; $tagNames = array(); foreach ($tags as $tagName) { $i++; if ($i <= PMF_TAGS_AUTOCOMPLETE_RESULT_SET_SIZE) { $tagNames[] = $tagName; } } echo json_encode(array('tags' => $tagNames)); }
* @since 2005-12-15 */ if (!defined('IS_VALID_PHPMYFAQ')) { header('Location: http://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['SCRIPT_NAME'])); exit; } header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); header("Cache-Control: no-store, no-cache, must-revalidate"); header("Cache-Control: post-check=0, pre-check=0", false); header("Pragma: no-cache"); header("Vary: Negotiate,Accept"); $oTag = new PMF_Tags(); $autoCompleteValue = PMF_Filter::filterInput(INPUT_GET, 'q', FILTER_SANITIZE_STRIPPED); if (!is_null($autoCompleteValue)) { $tags = $oTag->getAllTags($autoCompleteValue); } else { $tags = $oTag->getAllTags(); } if (count(ob_list_handlers()) > 0) { ob_clean(); } if ($permission['editbt']) { $i = 0; foreach ($tags as $tagName) { $i++; if ($i <= PMF_TAGS_AUTOCOMPLETE_RESULT_SET_SIZE) { print $tagName . "\n"; } } }