예제 #1
0
            echo 'ISSUE "' . $to_use . '" ' . strval($line) . ' ' . strval($pos) . ' ' . do_lang_local('MAIL_WEB_VERSION') . "\n";
        }
        $nasty_keywords = explode(chr(10), "\n4U\nAccept credit cards\nAct now! Don't hesitate!\nAdditional income\nAddresses on CD\nAll natural\nAmazing\nApply Online\nAs seen on\nBilling address\nAuto email removal\nAvoid bankruptcy\nBe amazed\nBe your own boss\nBeing a member\nBig bucks\nBill 1618\nBillion dollars\nBrand new pager\nBulk email\nBuy direct\nBuying judgments\nCable converter\nCall free\nCall now\nCalling creditors\nCannot be combined with any other offer\nCancel at any time\nCan't live without\nCash bonus\nCashcashcash\nCasino\nCell phone cancer scam\nCents on the dollar\nCheck or money order\nClaims not to be selling anything\nClaims to be in accordance with some spam law\nClaims to be legal\nClaims you are a winner\nClaims you registered with some kind of partner\nClick below\nClick here link\nClick to remove\nClick to remove mailto\nCompare rates\nCompete for your business\nConfidentially on all orders\nCongratulations\nConsolidate debt and credit\nStop snoring\nget it now\nSpecial promotion\nCopy accurately\nCopy DVDs\nCredit bureaus\nCredit card offers\nCures baldness\nDear email\nDear friend\nDear somebody\nDifferent reply to\nDig up dirt on friends\nDirect email\nDirect marketing\nDiscusses search engine listings\nDo it today\nDon't delete\nDrastically reduced\nEarn per week\nEasy terms\nEliminate bad credit\nEmail harvest\nEmail marketing\nExpect to earn\nFantastic deal\nFast Viagra delivery\nFinancial freedom\nFind out anything\nFor free\nFor instant access\nFor just \$ (some amt)\nFree access\nFree cell phone\nFree consultation\nFree DVD\nFree grant money \t\nFree hosting\nFree installation\nFree investment\nFree leads\nFree membership\nFree money\nFree offer\nFree preview\nFree priority mail\nFree quote\nFree sample\nFree trial\nFree website\nFull refund\nGet paid\nGet started now\nGift certificate\nGreat offer\nGuarantee\nHave you been turned down?\nHidden assets\nHome employment\nHuman growth hormone\nIf only it were that easy\nIn accordance with laws\nIncrease sales\nIncrease traffic\nInsurance\nInvestment decision\nIt's effective\nJoin millions of Americans\nLaser printer\nLimited time only\nLong distance phone offer\nLose weight spam\nLower interest rates\nLower monthly payment\nLowest price\nLuxury car\nMail in order form\nMarketing solutions\nMass email\nMeet singles\nMember stuff\nMessage contains disclaimer\nMoney back\nMoney making\nMonth trial offer\nMore Internet traffic\nMortgage rates\nMulti level marketing\nMLM\nName brand\nNew customers only\nNew domain extensions\nNigerian\nNo age restrictions\nNo catch\nNo claim forms\nNo cost\nNo credit check\nNo disappointment\nNo experience\nNo fees\nNo gimmick\nNo inventory\nNo investment\nNo medical exams\nNo middleman\nNo obligation\nNo purchase necessary\nNo questions asked\nNo selling\nNo strings attached\nNot intended\nOff shore\nOffer expires\nOffers coupon\nOffers extra cash\nOffers free (often stolen) passwords\nOnce in lifetime\nOne hundred percent free\nOne hundred percent guaranteed\nOne time mailing\nOnline biz opportunity \t\nOnline pharmacy\nOnly \$\nOpportunity\nOpt in\nOrder now\nOrder status\nOrders shipped by priority mail\nOutstanding values\nPennies a day\nPeople just leave money laying around\nPlease read\nPotential earnings\nPrint form signature\nPrint out and fax\nProduced and sent out\nProfits\nPromise you ...!\nPure profit\nReal thing\nRefinance home\nRemoval instructions\nRemove in quotes\nRemove subject\nRemoves wrinkles\nReply remove subject\nRequires initial investment\nReserves the right\nReverses aging\nRisk free\nRound the world\nS 1618\nSafeguard notice\nSatisfaction guaranteed\nSave \$\nSave big money\nSave up to\nScore with babes\nSection 301\nSee for yourself\nSent in compliance\nSerious cash\nSerious only\nShopping spree\nSign up free today\nSocial security number\nStainless steel\nStock alert\nStock disclaimer statement\nStock pick\nStrong buy\nStuff on sale\nSubject to credit\nSupplies are limited\nTake action now\nTalks about hidden charges\nTalks about prizes\nTells you it's an ad\nTerms and conditions\nThe best rates\nThe following form\nThey keep your money -- no refund!\nThey're just giving it away\nThis isn't junk\nThis isn't spam\nUniversity diplomas\nUnlimited\nUnsecured credit/debt\nUrgent\nUS dollars\nVacation offers\nViagra and other drugs\nWants credit card\nWe hate spam\nWe honor all\nWeekend getaway\nWhat are you waiting for?\nWhile supplies last\nWhile you sleep\nWho really wins?\nWhy pay more?\nWill not believe your eyes\nWinner\nWinning\nWork at home\nYou have been selected\nYour income");
        foreach ($nasty_keywords as $keyword) {
            $keyword = trim($keyword);
            if ($keyword == '') {
                continue;
            }
            if (strpos($contents, $keyword) !== false) {
                echo 'ISSUE "' . $to_use . '" ' . strval($line) . ' ' . strval($pos) . ' ' . do_lang_local('MAIL_FLASHWORD') . "\n";
            }
        }
    } else {
        $GLOBALS['MAIL_MODE'] = false;
    }
    $results = check_xhtml($contents, false, $is_fragment, true, true, true, true, $ext, $manual);
    // full check, but no external file checking
}
if (!is_null($results)) {
    $pedantic = in_array('checks', $_SERVER['argv']) || array_key_exists('pedantic', $_SERVER['argv']) && $_SERVER['argv']['pedantic'] == '1';
    $skip_over = $pedantic ? array() : array('XHTML_EMPTY_TAG', 'CSS_INLINE_STYLES', 'WCAG_ADJACENT_LINKS', 'XHTML_SPELLING');
    foreach ($results['errors'] as $result) {
        //echo ' '.implode(' ',$result['error'])."\n";
        $error_exp = trim(is_array($result['error']) ? implode(' ', $result['error']) : $result['error']);
        $sp = strpos($error_exp, ' ');
        if (in_array($sp === false ? $error_exp : substr($error_exp, 0, $sp), $skip_over)) {
            continue;
        }
        $error_exp_2 = trim(is_array($result['error']) ? do_lang_local($result['error'][0], @$result['error'][1], @$result['error'][2], @$result['error'][3]) : $result['error']);
        echo 'ISSUE "' . $to_use . '" ' . $result['line'] . ' ' . $result['pos'] . ' ' . html_entity_decode($error_exp_2) . "\n";
    }
예제 #2
0
 function testScreenPreview()
 {
     require_code('validation');
     require_lang('validation');
     global $DONE_HEADER, $RECORD_TEMPLATES_USED, $RECORDED_TEMPLATES_USED;
     $RECORD_TEMPLATES_USED = true;
     $only_do_these = array();
     $lists = find_all_previews__by_template();
     foreach ($lists as $template => $list) {
         $temp_name = basename($template, '.tpl');
         if (count($only_do_these) != 0) {
             if (!in_array($temp_name, $only_do_these)) {
                 continue;
             }
         }
         if ($temp_name == 'tempcode_test') {
             continue;
         }
         if (is_plain_text_template($temp_name)) {
             continue;
         }
         $hook = $list[0];
         $function = $list[1];
         if (is_file(get_file_base() . '/_tests/screens_tested/' . $function)) {
             continue;
         }
         // To make easier to debug through
         if (function_exists('set_time_limit')) {
             @set_time_limit(0);
         }
         $DONE_HEADER = false;
         $RECORDED_TEMPLATES_USED = array();
         $out = render_screen_preview($template, $hook, $function);
         $flag = false;
         foreach ($lists as $template_2 => $list_2) {
             $temp_name_2 = basename($template_2, '.tpl');
             if (count($only_do_these) != 0) {
                 if (!in_array($temp_name_2, $only_do_these)) {
                     continue;
                 }
             }
             if ($temp_name_2 == 'tempcode_test') {
                 continue;
             }
             if (is_plain_text_template($temp_name_2)) {
                 continue;
             }
             if ($list_2[1] == $function) {
                 if ($temp_name_2 == 'FORM_STANDARD_END' || $temp_name_2 == 'MENU_LINK_PROPERTIES') {
                     continue;
                 }
                 $this->assertTrue(in_array($temp_name_2, $RECORDED_TEMPLATES_USED), $template_2 . ' not used in preview as claimed in ' . $hook . '/' . $function);
                 if (!in_array($temp_name_2, $RECORDED_TEMPLATES_USED)) {
                     $flag = true;
                 }
             }
         }
         if (!is_object($out)) {
             fatal_exit('Claimed screen for ' . $template . ' is not defined');
         }
         $_out = $out->evaluate();
         $result = check_xhtml($_out, false, false, false, true, true, false, false);
         if (!is_null($result) && count($result['errors']) == 0) {
             $result = NULL;
         }
         $this->assertTrue(is_null($result), $hook . '/' . $temp_name);
         if (!is_null($result)) {
             require_code('view_modes');
             display_validation_results($_out, $result, false, false);
         } else {
             if (!$flag) {
                 fclose(fopen(get_file_base() . '/_tests/screens_tested/' . $function, 'wb'));
                 sync_file(get_file_base() . '/_tests/screens_tested/' . $function);
                 fix_permissions(get_file_base() . '/_tests/screens_tested/' . $function);
             }
         }
     }
 }
예제 #3
0
/**
 * Takes the output from the scripts, and check the XHTML for validity, then echoes the page, plus the validation results.
 *
 * @param  string			The XHTML to validate
 * @param  boolean		Display XHTML output regardless of whether there was an error or not
 * @param  integer		Whether we are opening up an XHTML-fragment in a preview box (0 means no, 1 means yes, 2 means we are asking for additional manual check information)
 * @set 0 1 2
 * @param  boolean		Whether to return Tempcode
 * @return string			Returned result (won't return it $ret is false)
 */
function do_xhtml_validation($out, $display_regardless = false, $preview_mode = 0, $ret = false)
{
    if (!$display_regardless && $preview_mode == 0) {
        $hash = md5($out);
        $test = $GLOBALS['SITE_DB']->query_value_null_ok('validated_once', 'hash', array('hash' => $hash));
        if (!is_null($test)) {
            return '';
        }
    }
    require_lang('validation');
    require_css('adminzone');
    require_code('obfuscate');
    require_code('validation');
    global $EXTRA_CHECK;
    $show = false;
    do {
        $error = check_xhtml($out, get_option('validation_xhtml') != '1', $preview_mode != 0, get_option('validation_javascript') == '1', get_option('validation_css') == '1', get_option('validation_wcag') == '1', get_option('validation_compat') == '1', get_option('validation_ext_files') == '1', $display_regardless || $preview_mode == 2);
        $show = count($error['errors']) != 0 || $display_regardless;
        if (!$show && get_option('validation_ext_files') == '1') {
            $out = array_pop($EXTRA_CHECK);
        }
    } while (!$show && !is_null($out) && get_option('validation_ext_files') == '1');
    if ($show) {
        return display_validation_results($out, $error, $preview_mode != 0, $ret);
    } elseif ($preview_mode == 0) {
        $GLOBALS['SITE_DB']->query_insert('validated_once', array('hash' => $hash), false, true);
    }
    return '';
}