fix-uploadcomments.php 661 Bytes
Newer Older
1 2 3
#! /usr/bin/php -q
<?php

Markus Sommer's avatar
Markus Sommer committed
4
die('Access denied');
5 6 7 8 9 10 11 12 13 14

// Defining circumstances for CLI mode:
define('TYPO3_cliMode', true);

define('PATH_thisScript', $_SERVER['PHP_SELF']);
require(dirname(PATH_thisScript) . '/conf.php');
require(dirname(PATH_thisScript) . '/' . $BACK_PATH . 'init.php');


$res = $TYPO3_DB->exec_SELECTquery(
Markus Sommer's avatar
Markus Sommer committed
15 16 17
    'uid, uploadcomment',
    'tx_ter_extensiondetails',
    '1'
18 19 20 21 22 23 24 25 26 27 28
);

$counter = 0;
while ($row = $TYPO3_DB->sql_fetch_assoc($res)) {
    $converted = (preg_replace('/[^\w\s"%&\[\]\(\)\.\,\;\:\/\?}!\$\/]/', '', $row['uploadcomment']));

    if (strpos($converted, 'defaultRenderMethod')) {
        echo($converted . chr(10));
    }
}

Markus Sommer's avatar
Markus Sommer committed
29
?>