fix-uploadcomments.php 653 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
#! /usr/bin/php -q
<?php

die ('Access denied');

// 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(
    'uid, uploadcomment', 'tx_ter_extensiondetails', '1'
);

$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));
    }
}

?>