Gentoo Archives: gentoo-user

From: roundyz@×××××××.ru
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] reading php file code in text editor
Date: Wed, 23 Jun 2010 14:03:56
Message-Id: 20100623142632.GA10342@Rimmer
In Reply to: Re: [gentoo-user] reading php file code in text editor by Mick
1 Mick wrote:
2
3 >> On 23 June 2010 13:48, <roundyz@×××××××.ru> wrote:
4 >> > Stroller wrote:
5 >> >
6 >> >>> On 23 Jun 2010, at 07:18, Mick wrote:
7 >> >>>
8 >> >>> > I am looking at some php files which are causing parsing errors in
9 >> >>> > Drupal, like:
10 >>
11 >> > @^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@
12 >> > See this line here with all the ^@, delete it, or better yet comment it
13 >> > out, and see if it runs the same, it is not part of the php file, so
14 >> > maybe it was dumped during a refactoring session or the like.
15 >>
16 >> Thanks guys,
17 >>
18 >> I've tried all sort of 'fixes' like trying to add escape characters,
19 >> using closing tags, completely deleting the null symbols and what not,
20 >> but loading the page in drupal still causes similar parsing errors
21 >> although not always at the last line.
22 >>
23 >> The files in question are attached in this message.
24 >>
25 >> When looking at them with a hex editor I see this:
26 >>
27 >> 000027b0 20 7d 0d 0a 20 20 20 20 24 6c 69 73 74 5f 70 72 | }.. $list_pr|
28 >> 000027c0 69 63 65 20 3d 20 21 65 6d 70 74 79 28 24 6e 6f |ice = !empty($no|
29 >> 000027d0 64 65 2d 3e 6c 69 73 74 5f 70 72 69 63 65 29 20 |de->list_price) |
30 >> 000027e0 26 26 20 24 6e 6f 64 65 2d 3e 6c 69 73 74 5f 70 |&& $node->list_p|
31 >> 000027f0 72 69 63 65 20 3e 20 30 3b 20 20 20 20 20 20 20 |rice > 0; |
32 >> 00002800 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
33 >> *
34 >> 00006170 00 00 00 00 00 00 00 00 |........|
35 >> 00006178
36 >>
37 >> It is the last 5 lines that seem to cause the problem. Any idea why
38 >> they are shown as binary in text editors (using vim, or less)?
39 >>
40 >> PS. I just looked at earlier (stable) versions of these files here:
41 >>
42 >> http://drupal.org/project/skinr
43 >>
44 >> and here:
45 >>
46 >> http://drupal.org/project/fusion
47 >>
48 >> and they do not have the binary characters at the end - so this could
49 >> well be a problem with the development versions. I'll try the stable
50 >> versions when I get home and report back.
51
52
53 You could use split to chop of the last 5 lines....
54
55
56
57 --
58 Regards,
59 Roundyz