Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2008-04-02 22:26:18

the_ghost
Plugin Author
From: Minsk, The Republic of Belarus
Registered: 2007-07-26
Posts: 907
Website

<txp:permlink>zero</txp:permlink> kills textpattern

The problem is that when txp parses code <txp:permlink id="589" title="Цистолитотомия"></txp:permlink> (or any other where there is nothing between brackets) browser show clear screen – even tagtrace doesn’t work.


Providing help in hacking ATM! Come to courses and don’t forget to bring us notebook and hammer! What for notebook? What a kind of hacker you are without notebok?

Offline

#2 2008-04-02 23:57:17

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

Re: <txp:permlink>zero</txp:permlink> kills textpattern

Shouldn’t it be used as a single tag in that situation – <txp:permlink id="589" title="Цистолитотомия" />?


Stuart

In a Time of Universal Deceit
Telling the Truth is Revolutionary.

Offline

#3 2008-04-03 03:54:46

jm
Plugin Author
From: Missoula, MT
Registered: 2005-11-27
Posts: 1,746
Website

Re: <txp:permlink>zero</txp:permlink> kills textpattern

Another case of the white-screen bug. I haven’t found what causes it, but in the interest of data collection, what mode (debugging, testing, live) are you in, and what version of PHP are you using?

Offline

#4 2008-04-03 05:48:34

the_ghost
Plugin Author
From: Minsk, The Republic of Belarus
Registered: 2007-07-26
Posts: 907
Website

Re: <txp:permlink>zero</txp:permlink> kills textpattern

thebombsite – The aim is to use <></> tag, but somtimes filling is missing :)
jm – changing site mode (testing, debug and live) doesn’t changes the situation – just tested.

Diagnostic:

Textpattern version: 4.0.5 (r2466)
Last Update: 2007-11-04 19:39:33/2007-11-04 18:44:30
Document root: /home/u78707/uromax.ru/www
$path_to_site: /home/u78707/uromax.ru/www
Textpattern path: /home/u78707/uromax.ru/www/textpattern
Permanent link mode: section_title
open_basedir: /home/u78707/
upload_tmp_dir: /home/u78707/uromax.ru/tmp/
Temporary directory path: /home/u78707/uromax.ru/www/textpattern/tmp
web_domain: uromax.ru
PHP version: 5.2.5
Register globals: 1
GD Image Library: version bundled (2.0.34 compatible), supported formats: GIF, JPG, PNG
Server Local Time: 2008-04-03 09:47:43
MySQL: 5.0.45-log
Locale: en_US.UTF-8
Server: Apache
Apache version: Apache
PHP Server API: apache
RFC 2616 headers:
Server OS: FreeBSD 6.2-RELEASE-p1
Active plugins: rss_admin_db_manager-4.3, rss_unlimited_categories-0.7.4, ras_if_article_image-4.1.0, rss_auto_excerpt-0.5, dzd_counter_view-0.2m, chh_if_data-0.10, wet_peex-0.3, wet_quicklink-0.4.5, lam_article_info-0.1m, ob1_pagination-2.5, zem_contact_reborn-4.0.3.20, zem_contact_lang-4.0.3.6m, nok_edit_alarm-0.1a, asy_sitemap-0.7m, rss_if_search_results-0.1, rss_article_edit-0.1, upm_quicktags-0.5, lam_image_uploader-0.6cm, smd_if-0.51, lam_accordion_section-0.1, upm_file-0.3.1, tjh_listfilter-0.5, hcg_templates-0.3, ied_plugin_composer-0.74

Pre-flight check:
————————————
Some Textpattern files have been modified: /lib/classTextile.php
The following PHP functions (which may be necessary to run Textpattern) are disabled on your server: proc_nice, proc_get_status, proc_close, proc_terminate, posix_mkfifo, set_time_limit, chgrp
————————————

.htaccess file contents:
————————————
#DirectoryIndex index.php index.html

#Options +FollowSymLinks
#Options -Indexes

<IfModule mod_rewrite.c> RewriteEngine On #RewriteBase /relative/web/path/

RewriteCond %{REQUEST_FILENAME} -f [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^(.+) – [PT,L]

RewriteRule ^(.*) index.php
</IfModule>

#php_value register_globals 0
————————————

Last edited by the_ghost (2008-04-03 05:52:47)


Providing help in hacking ATM! Come to courses and don’t forget to bring us notebook and hammer! What for notebook? What a kind of hacker you are without notebok?

Offline

#5 2008-04-03 17:41:27

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: <txp:permlink>zero</txp:permlink> kills textpattern

Victor,

Does this only happen with the <txp:permlink></txp:permlink> tag construct or also with other container tag that are left empty or also with other tags that can be used as a container and as a non-container tag?
What happens if you do this with a tag that cannot be used as a container tag like: <txp:site_name></txp:sitename>

if you edit /textpattern/publish.php and change the parse function into the code below, does that solve the <txp:permlink></txp:permlink> problem (the only change is to replace the second + with *:

        function parse($text)
        {
                $f = '/<txp:(\S+)\b(.*)(?:(?<!br )(\/))?'.chr(62).'(?(3)|(.*)<\/txp:\1>)/sU';
                return preg_replace_callback($f, 'processTags', $text);
        }

Offline

#6 2008-04-03 19:46:15

the_ghost
Plugin Author
From: Minsk, The Republic of Belarus
Registered: 2007-07-26
Posts: 907
Website

Re: <txp:permlink>zero</txp:permlink> kills textpattern

It seems that txp dies with <txp:link_to_home></txp:link_to_home> tag too.
<txp:site_name></txp:sitename> kills txp too.

Editted as adviced – works!
<txp:link_to_home></txp:link_to_home> outputs just http://uromax.ru/ :)


Providing help in hacking ATM! Come to courses and don’t forget to bring us notebook and hammer! What for notebook? What a kind of hacker you are without notebok?

Offline

#7 2008-04-03 20:33:36

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: <txp:permlink>zero</txp:permlink> kills textpattern

Without the edit, does it matter if you do this:

<txp:permlink></txp:permlink>  <txp:sitename />

or this:

<txp:permlink></txp:permlink>
a lot of text here. Put a chunk of lorem ipsum here for example.
<txp:sitename />
bunch of other tags or text/html here as well.

Because what happened in the old situation is that the permlink end tag wasn’t detected, because there had to be some content between the opening and closing tag.
If there isn’t a closing permlink tag elsewhere in the template, the parser assumes the opening tag was incomplete (by ignoring the closing > in <txp:permlink>) and then incorrectly uses <txp:permlink></txp:permlink> as the opening tag… and starts looking again for the closing permlink tag. Can’t find it, so it continues until the next /> which makes it a self closing tag: <txp:permlink></txp:permlink> <txp:sitename /> is then interpreted as the <txp:permlink /> tag, having ></txp:permlink> <txp:sitename as attributes.

If there isn’t a /> nearby, I suspect this can take a lot of backtracing in the regular expression used for parsing the TXP tags, which may cause an error that isn’t shown by PHP. Just speculating, because I can’t reproduce the white-screen symptom.

Offline

#8 2008-04-03 21:21:37

the_ghost
Plugin Author
From: Minsk, The Republic of Belarus
Registered: 2007-07-26
Posts: 907
Website

Re: <txp:permlink>zero</txp:permlink> kills textpattern

  • <txp:permlink></txp:permlink><txp:permlink />works
  • <txp:permlink></txp:permlink>doesn’t works

I think, if you want to reproduce this error you should place this tags in the end of some form to be sure there are no any txp tags after :)


Providing help in hacking ATM! Come to courses and don’t forget to bring us notebook and hammer! What for notebook? What a kind of hacker you are without notebok?

Offline

#9 2008-04-03 21:31:02

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: <txp:permlink>zero</txp:permlink> kills textpattern

I actually tested it like this:

<txp:permlink></txp:permlink>
... some text here...
<txp:comments sort="Posted Desc" />

And it gave me an error that said something like: sort is not a valid attribute for the permlink tag. So the first permlink opening tag was seen as a self-closing tag that closed at the end of the comments tag, which make TXP think the sort attribute was set for the permlink tag :)

Fixed in SVN.

Offline

Board footer

Powered by FluxBB