Beispiel #1
0
    $highlight = str_replace("'", "´", $highlight);
    $highlight = str_replace(array('^', '.', '?', '*', '+', '{', '}', '(', ')', '[', ']'), '', $highlight);
    $highlight = preg_quote($highlight, '/');
    $searchItems = explode(' ', $highlight);
    $attributes = array('href', 'src', 'title', 'alt', 'class', 'style', 'id', 'name', 'face', 'size', 'dir', 'onclick', 'ondblclick', 'onmousedown', 'onmouseup', 'onmouseover', 'onmousemove', 'onmouseout', 'onkeypress', 'onkeydown', 'onkeyup');
    foreach ($searchItems as $item) {
        $thema = PMF_String::preg_replace_callback('/' . '(' . $item . '="[^"]*")|' . '((' . implode('|', $attributes) . ')="[^"]*' . $item . '[^"]*")|' . '(\\s+)(' . $item . ')(\\s+)' . '/mis', 'highlight_no_links', $thema);
        $content = PMF_String::preg_replace_callback('/' . '(' . $item . '="[^"]*")|' . '((' . implode('|', $attributes) . ')="[^"]*' . $item . '[^"]*")|' . '(\\s+)(' . $item . ')(\\s+)' . '/mis', 'highlight_no_links', $content);
    }
}
// Hack: Apply the new SEO schema to those HTML anchors to
//       other faq records (Internal Links) added with WYSIWYG Editor:
//         href="index.php?action=artikel&cat=NNN&id=MMM&artlang=XYZ"
// Search for href attribute links
$oLnk->resetPool();
$oLnk->parse_string($content);
$fixedContent = str_replace('href="#', sprintf('href="index.php?action=artikel&lang=%s&cat=%d&id=%d&artlang=%s#', $LANGCODE, $currentCategory, $record_id, $LANGCODE), $content);
$oLnk->resetPool();
$oLnk->parse_string($fixedContent);
// Search for href attributes only
$linkArray = $oLnk->getUrlpool();
if (isset($linkArray['href'])) {
    foreach (array_unique($linkArray['href']) as $_url) {
        if (!(strpos($_url, 'index.php?action=artikel') === false)) {
            // Get the Faq link title
            $matches = array();
            preg_match('/id=([\\d]+)/ism', $_url, $matches);
            $_id = $matches[1];
            $_title = $faq->getRecordTitle($_id, false);
            $_link = substr($_url, 9);
            // Move the link to XHTML
Beispiel #2
0
if (!is_null($highlight) && $highlight != "/" && $highlight != "<" && $highlight != ">" && PMF_String::strlen($highlight) > 3) {
    $highlight = str_replace("'", "´", $highlight);
    $highlight = str_replace(array('^', '.', '?', '*', '+', '{', '}', '(', ')', '[', ']'), '', $highlight);
    $highlight = preg_quote($highlight, '/');
    $searchItems = explode(' ', $highlight);
    foreach ($searchItems as $item) {
        $question = PMF_Utils::setHighlightedString($question, $item);
        $answer = PMF_Utils::setHighlightedString($answer, $item);
    }
}
// Hack: Apply the new SEO schema to those HTML anchors to
//       other faq records (Internal Links) added with WYSIWYG Editor:
//         href="index.php?action=artikel&cat=NNN&id=MMM&artlang=XYZ"
// Search for href attribute links
$oLnk->resetPool();
$oLnk->parse_string($answer);
$fixedContent = str_replace('href="#', sprintf('href="index.php?action=artikel&amp;lang=%s&amp;cat=%d&amp;id=%d&amp;artlang=%s#', $LANGCODE, $currentCategory, $faq->faqRecord['id'], $LANGCODE), $answer);
$oLnk->resetPool();
$oLnk->parse_string($fixedContent);
// Search for href attributes only
$linkArray = $oLnk->getUrlpool();
if (isset($linkArray['href'])) {
    foreach (array_unique($linkArray['href']) as $_url) {
        $xpos = strpos($_url, 'index.php?action=artikel');
        if (!($xpos === false)) {
            // Get the Faq link title
            $matches = array();
            preg_match('/id=([\\d]+)/ism', $_url, $matches);
            $_id = $matches[1];
            $_title = $faq->getRecordTitle($_id, false);
            $_link = substr($_url, $xpos + 9);
Beispiel #3
0
if ($linkverifier->isReady() == false) {
    if (count(ob_list_handlers()) > 0) {
        ob_clean();
    }
    print "disabled";
    exit;
}
$linkverifier->loadConfigurationFromDB();
$id = PMF_Filter::filterInput(INPUT_GET, 'id', FILTER_VALIDATE_INT);
$lang = PMF_Filter::filterInput(INPUT_GET, 'lang', FILTER_SANITIZE_STRING);
if (!(isset($id) && isset($lang))) {
    //header("X-DenyReason: id/lang bad");
    header("HTTP/1.0 401 Unauthorized");
    header("Status: 401 Unauthorized");
    exit;
}
$faq->faqRecord = null;
$faq->getRecord($id);
if (!isset($faq->faqRecord['content'])) {
    header("HTTP/1.0 401 Unauthorized");
    header("Status: 401 Unauthorized");
    exit;
}
if (count(ob_list_handlers()) > 0) {
    ob_clean();
}
$linkverifier->parse_string($faq->faqRecord['content']);
$linkverifier->VerifyURLs($faqconfig->get('main.referenceURL'));
$linkverifier->markEntry($id, $lang);
print $linkverifier->getLinkStateString();
exit;
Beispiel #4
0
    $highlight = str_replace("'", "´", $highlight);
    $highlight = str_replace(array('^', '.', '?', '*', '+', '{', '}', '(', ')', '[', ']'), '', $highlight);
    $highlight = preg_quote($highlight, '/');
    $searchItems = explode(' ', $highlight);
    $attributes = array('href', 'src', 'title', 'alt', 'class', 'style', 'id', 'name', 'face', 'size', 'dir', 'onclick', 'ondblclick', 'onmousedown', 'onmouseup', 'onmouseover', 'onmousemove', 'onmouseout', 'onkeypress', 'onkeydown', 'onkeyup');
    foreach ($searchItems as $item) {
        $thema = PMF_String::preg_replace_callback('/' . '(' . $item . '="[^"]*")|' . '((' . implode('|', $attributes) . ')="[^"]*' . $item . '[^"]*")|' . '(\\s+)(' . $item . ')(\\s+)' . '/mis', 'highlight_no_links', $thema);
        $content = PMF_String::preg_replace_callback('/' . '(' . $item . '="[^"]*")|' . '((' . implode('|', $attributes) . ')="[^"]*' . $item . '[^"]*")|' . '(\\s+)(' . $item . ')(\\s+)' . '/mis', 'highlight_no_links', $content);
    }
}
// Hack: Apply the new SEO schema to those HTML anchors to
//       other faq records (Internal Links) added with WYSIWYG Editor:
//         href="index.php?action=artikel&cat=NNN&id=MMM&artlang=XYZ"
// Search for href attribute links
$oLnk->resetPool();
$oLnk->parse_string($content);
$fixedContent = $content;
// Search for href attributes only
if (isset($oLnk->urlpool['href'])) {
    $linkArray = array_unique($oLnk->urlpool['href']);
    foreach ($linkArray as $_url) {
        if (!(strpos($_url, 'index.php?action=artikel') === false)) {
            // Get the Faq link title
            preg_match('/id=([\\d]+)/ism', $_url, $matches);
            $_id = $matches[1];
            preg_match('/artlang=([a-z\\-]+)$/ism', $_url, $matches);
            $_lang = $matches[1];
            $_title = $faq->getRecordTitle($_id, false);
            $_link = substr($_url, 9);
            // Move the link to XHTML
            if (strpos($_url, '&amp;') === false) {