-
Notifications
You must be signed in to change notification settings - Fork 46
/
index.php
59 lines (51 loc) · 1.25 KB
/
index.php
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/usr/local/bin/php -q
<?php
/***************************************************************************
* For license information see doc/license.txt
*
* Unicode Reminder メモ
***************************************************************************/
$rootpath = '../../';
require($rootpath . 'lib/clicompatbase.inc.php');
/* begin db connect */
db_connect();
if ($dblink === false)
{
echo 'Unable to connect to database';
exit;
}
/* end db connect */
// zeichen die nicht am beginn eines Caches sein dürfen
$evils[] = " ";
$evils[] = "\n";
$evils[] = "\r";
$rs = sql("SELECT `cache_id`, `name` FROM `caches` WHERE `name`<'\"' ORDER BY `name` ASC");
while ($r = sql_fetch_array($rs))
{
$name = $r['name'];
$bFound = true;
while ($bFound == true)
{
$bFound = false;
for ($j = 0; $j < count($evils); $j++)
{
if (mb_substr($name, 0, 1) == $evils[$j])
{
$name = mb_substr($name, 1);
$bFound = true;
}
}
}
if ($name != '')
{
if ($name != $r['name'])
{
echo "Changed name to: " . $name . "\n";
sql("UPDATE `caches` SET `name`='&1' WHERE `cache_id`=&2", $name, $r['cache_id']);
}
}
else
echo 'new name would be empty, not changing' . "\n";
}
sql_free_result($rs);
?>