Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2017-07-15 17:32:26

whocarez
Plugin Author
From: Germany/Ukraine
Registered: 2007-10-08
Posts: 223
Website

strange behaviour of plugin after update to 4.6.2

Hello, after updating from 4.5.7 links in this old pap_xpoll Plugin aren’t generated right. Instead of a ? links get a & in the relevant query string. After playing a little bit around, I figured out that $_SERVER['QUERY_STRING'] is really not empty on an article page without any parameter. It has the value $1. Where does it come from? Is this textpattern or something else?
This value disturbs this part of the code.

        $request_uri = $_SERVER['REQUEST_URI'];
        if (!empty($_SERVER['QUERY_STRING'])) {

            parse_str($_SERVER['QUERY_STRING'], $querystring);
            $countstring = count($querystring);
            $count = 0;
            if (isset($_GET['poll'])) {
            $regexp = '#[&?]poll=[0-9]+&option=[0-9]+&pap_xpoll_submit=1#';
                $request_uri = preg_replace($regexp, '', $request_uri);
                $count += 3;
            }
            if (isset($_GET['results'])) {
                $regexp = '#[&?]results=[0-9]+#';
                $replace = 'results=' . $poll . '#umfrage';
                $request_uri = preg_replace($regexp, $replace, $request_uri);
            } else {
                if ($countstring - $count > 0) {
                    $request_uri .= '&';
                } else {
                    $request_uri .= '?';
                }
                $request_uri .= 'results=' . $poll . '#umfrage';
            }
        } else {
            $request_uri .= '?results=' . $poll . '#umfrage';
        }
              $preview = '<a href="' . $request_uri . '"' . $class . ' rel="nofollow">' .  gTxt('view_results') . '</a>';

In 4.5.7 the query_string is really empty ….

PHP-Version: 5.4.45-0+deb7u8

Last edited by whocarez (2017-07-15 18:21:36)

Offline

#2 2017-07-15 18:12:46

whocarez
Plugin Author
From: Germany/Ukraine
Registered: 2007-10-08
Posts: 223
Website

Re: strange behaviour of plugin after update to 4.6.2

I tried also switching off all other plugins and changed custom_url mode. Doesn’t work except of course for messy urls.

Textpattern version: 4.6.2 (8412e32468526e075446b881d13bd9ce)
Last update: 2017-04-13 11:47:48/2016-10-21 07:49:48
Document root: /var/www/test
$path_to_site: /var/www/test
Textpattern path: /var/www/test/textpattern
Article URL pattern: title_only
Temporary directory path: /var/www/test/textpattern/tmp
Site URL: test
PHP version: 5.4.45-0+deb7u8
GD Graphics Library: 2.0.36; supported formats: GIF, JPG, PNG.
Server TZ: Europe/Berlin
Server local time: 2017-07-15 20:14:24
Daylight Saving Time enabled?: 1
Automatically adjust Daylight Saving Time setting?: 1
Time zone (GMT offset in seconds): Europe/Kiev (7200)
MySQL: 10.1.25-MariaDB-1~wheezy
Database server time: 2017-07-15 20:14:24
Database server time offset: 1 s
Database server timezone: SYSTEM
Database session timezone: SYSTEM
Locale: en_GB.UTF-8
Server: Lighttpd 1.4.45 on Debian Squeeze
PHP server API: fpm-fcgi
RFC 2616 headers: 0
Server OS: Linux 3.2.41-042stab120.16
Active plugins: pap_xpoll-0.2bm
Admin-side theme: hive 4.6.2

Pre-flight check: 
------------------------
Clean URLs are only supported on Apache, use at your own risk.
/var/www/test/textpattern/setup/ still exists
The following PHP functions (which may be necessary to run Textpattern) are disabled on your server: pcntl_alarm, pcntl_fork, pcntl_waitpid, pcntl_wait, pcntl_wifexited, pcntl_wifstopped, pcntl_wifsignaled, pcntl_wexitstatus, pcntl_wtermsig, pcntl_wstopsig, pcntl_signal, pcntl_signal_dispatch, pcntl_get_last_error, pcntl_strerror, pcntl_sigprocmask, pcntl_sigwaitinfo, pcntl_sigtimedwait, pcntl_exec, pcntl_getpriority, pcntl_setpriority, 
Clean URL test failed.
------------------------

.htaccess file contents: 
------------------------
# BEGIN Textpattern
#DirectoryIndex index.php index.html

#Options +FollowSymLinks
#Options -Indexes
#ErrorDocument 403 default

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

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

    RewriteCond %{REQUEST_URI} !=/favicon.ico
    RewriteRule ^(.*) index.php

    RewriteCond %{HTTP:Authorization}  !^$
    RewriteRule .* - [E=REMOTE_USER:%{HTTP:Authorization}]
</IfModule>

#php_value register_globals 0

<IfModule mod_mime.c>
    AddType image/svg+xml  svg svgz
    AddEncoding gzip       svgz
</IfModule>
# END Textpattern

------------------------

Charset (default/config): latin1/utf8
character_set_client: utf8
character_set_connection: utf8
character_set_database: utf8
character_set_filesystem: binary
character_set_results: utf8
character_set_server: utf8
character_set_system: utf8
character_sets_dir: /usr/share/mysql/charsets/
20 Tables: OK

10 Custom fields: custom_1, custom_2, custom_3, custom_4, custom_5, custom_6, custom_7, custom_8, custom_9, custom_10 (10)

PHP extensions: Core/5.4.45-0+deb7u8, date/5.4.45-0+deb7u8, ereg, libxml, openssl, pcre, zlib/2.0, bcmath, bz2, calendar, ctype, dba, dom/20031129, hash/1.0, fileinfo/1.0.5, filter/0.11.0, ftp, gettext, SPL/0.2, iconv, json/1.2.1, mbstring, session, posix, Reflection/$Id: f6367cdb4e3f392af4a6d441a6641de87c2e50c4 $, standard/5.4.45-0+deb7u8, shmop, SimpleXML/0.1, soap, sockets, Phar/2.0.1, exif/1.4 $Id: 05041c5f0094cb46d9b516bd624d593b90cc38f9 $, sysvmsg, sysvsem, sysvshm, tokenizer/0.1, wddx, xml, xmlreader/0.1, xmlwriter/0.1, zip/1.11.0, cgi-fcgi, PDO/1.0.4dev, curl, gd, geoip/1.0.7, imap, intl/1.1.0, mcrypt, mysql/1.0, mysqli/0.1, pdo_mysql/1.0.2, pdo_sqlite/1.0.1, pspell, recode, rrd/1.1.0, sqlite3/0.7, suhosin/0.9.38, tidy/2.0, XCache/3.2.1, imagick/3.1.0RC1, mhash, XCache Optimizer/3.2.1, XCache Cacher/3.2.1

/../index.php: 
	91b2dbb550c73fe2a7f8bad6c0c165b3
/../css.php: 
	1872823dbb091f1a3e28d37018a25917
/admin-themes/classic/classic.php: 
	d9b7586b795cd0c3cfed0cc3de1a737f
/admin-themes/hive/hive.php: 
	d01bc2e963a848ae28d13df9c0cbfefd
/admin-themes/hiveneutral/hiveneutral.php: 
	9fe45801d23c69e90b6e771f7d621754
/css.php: 
	15b5eb655ba4f162361c30ed083502d0
/include/txp_admin.php: 
	6e1b2ec212f673fae4022da9e1dee03e
/include/txp_article.php: 
	12a156ffb905daafc55bb76d16f3b3c4
/include/txp_auth.php: 
	3c53dc12daf2818a58b65d26dc995358
/include/txp_category.php: 
	b82bf6f9668fb3953786cc8ea6c72e26
/include/txp_css.php: 
	275baaa28814a719d890a895a730e78e
/include/txp_diag.php: 
	1236dbc50fcd292555e17a5357d257b0
/include/txp_discuss.php: 
	28d572167f576f7ababc3138a23fc77b
/include/txp_file.php: 
	b24d3c19ed68ab8d0ba9dcfdbf9822bf
/include/txp_form.php: 
	aa456de76a14187399fcf113b6843973
/include/txp_image.php: 
	43e37f80bce83a3cc8a4b5058328bba2
/include/txp_lang.php: 
	6e0c06bd366837d4b23bd755f7a54d9b
/include/txp_link.php: 
	6e8fa57564b1cc72181ee54b3bd9b10f
/include/txp_list.php: 
	e69e39f2dae2f81c814dc88b8a09b8b7
/include/txp_log.php: 
	6474bae0873b4b66a4ffab7b0fafe86b
/include/txp_page.php: 
	4f84cb835a5a4c0974b3359ec5ac691d
/include/txp_pane.php: 
	a6fd0eb91f9a9d2454f558ce82dd236c
/include/txp_plugin.php: 
	c10be88d56fe2daa3a297d6a5a4bc7ae
/include/txp_prefs.php: 
	6951674c8e3267b9171acf90e52a28a4
/include/txp_section.php: 
	9a9bb075ec2ae48a8898392a28f80c10
/include/txp_tag.php: 
	b06927b4f0304e7ee8a7e88f2615d6d2
/index.php: 
	73f449df6cee012fcfcdf005a8710a30
/lib/IXRClass.php: 
	a1b525b4a9ed12dcb5677d5232a3d92e
/lib/PasswordHash.php: 
	40e06a9c70b96309728e0a02822a6722
/lib/admin_config.php: 
	e81e53b7c3083ac599967072df52c49f
/lib/class.thumb.php: 
	385ecc1a5c59561db667c2490a1d45c8
/lib/class.trace.php: 
	0ee318488a6f48da87f0c0cf6fe323f9
/lib/classTextile.php: 
	bc332cd871af9aea59d1f0a20e6e47cb
/lib/constants.php: 
	be11b7315b4a9505e2d2ab0ab04c2ab7
/lib/taglib.php: 
	f1b871e7ff90028d3cd12a944b4c2153
/lib/txplib_admin.php: 
	fb66c1420b71d18416181df1f09dfcb3
/lib/txplib_db.php: 
	ffdb7520a8da7d45f244dd6052b22df6
/lib/txplib_forms.php: 
	c61b2af91351854c8df777d2b8097e9f
/lib/txplib_head.php: 
	c74b4a61144f6020fb513fbe2d446ce2
/lib/txplib_html.php: 
	2a6520ac0de472e03f48963570359ea2
/lib/txplib_misc.php: 
	44e673f4994eee5a65552e496ae1c578
/lib/txplib_publish.php: 
	b5707fa079d073cb8f2ba138c09c0d70
/lib/txplib_theme.php: 
	6de524114ee36d72ce424a77b92051ed
/lib/txplib_update.php: 
	477518d6ecc2ab603ffa9439df4b3720
/lib/txplib_validator.php: 
	7bf016bf3449424b84c15dfe3544e329
/lib/txplib_wrapper.php: 
	be2a8ee0e5a16a67cfb366802d5d0176
/publish.php: 
	805fd06782ecd44b3ed42fabc54a954c
/publish/atom.php: 
	9dffcb3fa3a6c7990f731e8c8073b76c
/publish/comment.php: 
	49004f3d722f096741eb685fa1817a45
/publish/log.php: 
	d99b408d6bf88b39865dab18cfaf73a2
/publish/rss.php: 
	af420738b7d5c6e1e97fdbcffa527a62
/publish/search.php: 
	3d7e0fcea6f40d31dae8c7fb208e35e6
/publish/taghandlers.php: 
	5653e0dcd45db67c5607db6d386738fb
/textpattern.js: 
	d7654c4b09d4b59f08d72a0701e91771
/update/_to_1.0.0.php: 
	038fee881209aae809666177852f0c64
/update/_to_4.0.2.php: 
	2fda6b67e48855a503d31b226739c1e8
/update/_to_4.0.3.php: 
	0ed87e575b17dc7a5c96ae68a3d16397
/update/_to_4.0.4.php: 
	bf3676db9029bcd37c2df43bef3443f0
/update/_to_4.0.5.php: 
	fa4026347c767cfbd6450cd98c9e37f6
/update/_to_4.0.6.php: 
	6e9a6eb010ba628e77fb00bfb5a0c62a
/update/_to_4.0.7.php: 
	f72fc3ee07beb2a63a56057187daf136
/update/_to_4.0.8.php: 
	0d96bca3d788b371b54e925bb3b006a0
/update/_to_4.2.0.php: 
	efcc7e8a390968de49fd8e060f5e01a4
/update/_to_4.3.0.php: 
	6a819428ad8c1952a7ce5e394abe2823
/update/_to_4.5.0.php: 
	328e41695d6fd6be1c3e18b86e91ab08
/update/_to_4.5.7.php: 
	12f67c98bc6479b54dc7f02cade86638
/update/_to_4.6.0.php: 
	993a0ce529653a6cc4de3a4c454514a8
/update/_update.php: 
	a797c3f31953d468747755b1f30a687f
/vendors/dropbox/zxcvbn/zxcvbn.js: 
	0592f04743d1d2b81b21b6c57c2e9dc7
/vendors/jquery/jquery/jquery.js: 
	4f252523d4af0b478c810c2547a63e19
/vendors/jquery/jquery-ui/jquery-ui.js: 
	0a497d4661df7b82feee14332ce0bdaf
/vendors/PrismJS/prism/prism.js: 
	9987be40687dad6b26f400b8ce7d4a54
/vendors/Netcarver/Textile/DataBag.php: 
	63e6f6033871535df2494a0253ceb691
/vendors/Netcarver/Textile/Parser.php: 
	f78b64f1082064fa92524e5f8a0682b4
/vendors/Netcarver/Textile/Tag.php: 
	a7f254b354148a092dbb7ae2f91482ee
/vendors/Textpattern/Adaptable/AdapterInterface.php: 
	de8792292a384f8a51f07d8c1e24c1e5
/vendors/Textpattern/Adaptable/Providable.php: 
	db58e36723a5e6169cdab51407ec3e61
/vendors/Textpattern/Adaptable/ProvidableInterface.php: 
	fe415c23619c580543a415c8872d2761
/vendors/Textpattern/Admin/Theme.php: 
	eede702ee31d32d67b9ed3ea58287dd1
/vendors/Textpattern/Container/Container.php: 
	8aa23f3dd76ae9515e01f92210fca272
/vendors/Textpattern/Container/ContainerInterface.php: 
	73fdfc8a970ba41953207f18e245436b
/vendors/Textpattern/Container/FactorableInterface.php: 
	7a5493a74358c0f9cb362119565c0b8a
/vendors/Textpattern/Container/FactoryInterface.php: 
	231dca8874a1e894afbf57de8b343620
/vendors/Textpattern/Container/ReusableInterface.php: 
	df4edfb5a1ae3d43f0ad257139647dbd
/vendors/Textpattern/Date/Timezone.php: 
	d83b6ea7db588599b81709f85c600b1b
/vendors/Textpattern/Filter/Exception.php: 
	9dfad03467f770dfe5fea7f4c3886cfb
/vendors/Textpattern/Filter/FilterCallable.php: 
	ff71a066bde804ec70a4ef5a32ed7d79
/vendors/Textpattern/Filter/StringFilter.php: 
	aa39802e3186f455cf46071ea4e21cf9
/vendors/Textpattern/Http/Request.php: 
	eb603f3a3aee03861cf57f59851ff5a6
/vendors/Textpattern/Iterator/FileIterator.php: 
	0b92ccce27d3dc6684914c14a645bf54
/vendors/Textpattern/L10n/Locale.php: 
	da92218be29aa7573b5768c2f6d4cf7e
/vendors/Textpattern/Loader.php: 
	5132ee7aec8a6be0e0a19984c5fb68ca
/vendors/Textpattern/Mail/Adapter/Mail.php: 
	7d09ff9ec0f6c042bc37af0521af255f
/vendors/Textpattern/Mail/AdapterInterface.php: 
	5c374a13da2b48765337daf6564608c8
/vendors/Textpattern/Mail/Compose.php: 
	c26a947697ba18e05aa6dcab94baee5d
/vendors/Textpattern/Mail/Encode.php: 
	0dc0530c9033491519a097130402c711
/vendors/Textpattern/Mail/Exception.php: 
	ce0c04106b33126de84b777ba80c9950
/vendors/Textpattern/Mail/Message.php: 
	e35c47b7bf47cbcbd9f96864941b3689
/vendors/Textpattern/Password/Adapter/PasswordHash.php: 
	53d6862f0d1dada12218ab3aace85162
/vendors/Textpattern/Password/AdapterInterface.php: 
	a23c46382eff2c784f5e549eb17160b4
/vendors/Textpattern/Password/Generator.php: 
	0b2697558cda93525de4bf4671e49453
/vendors/Textpattern/Password/Hash.php: 
	7404c7e10f304be5089b6607c235a602
/vendors/Textpattern/Password/Random.php: 
	e2d21125ea9fc2567157080a137c9473
/vendors/Textpattern/Search/Filter.php: 
	8b4ef3fd8511467ee5f6026c748e259c
/vendors/Textpattern/Search/Method.php: 
	9de58b5033c9c0b61bef5d5f92bef75a
/vendors/Textpattern/Security/Exception.php: 
	1271a06d808208d3fc208cbe675555a0
/vendors/Textpattern/Security/Filter.php: 
	5a15e72dd32ab2f616c219742fbdee7c
/vendors/Textpattern/Server/Config.php: 
	33ae325df3a4c5788908ad49bab86c04
/vendors/Textpattern/Tag/Registry.php: 
	9bd60f0c914e97f5ec894f46437adda1
/vendors/Textpattern/Tag/Syntax/Authors.php: 
	c29c9244f8a1009483c634d78df01bf5
/vendors/Textpattern/Tag/Syntax/File.php: 
	705562c46df238e113a3c29a2f1cb3c1
/vendors/Textpattern/Tag/Syntax/Image.php: 
	d8917b9156ec10930bacdd209ae93bc7
/vendors/Textpattern/Tag/Syntax/Link.php: 
	80f8b01a48682d20649b739a574ba690
/vendors/Textpattern/Tag/Syntax/Partial.php: 
	657fa060189b64a08e2cbd241b759b77
/vendors/Textpattern/Textfilter/Base.php: 
	0496350b655278e555c139d6a00d559d
/vendors/Textpattern/Textfilter/Constraint.php: 
	03b065d525667b360b31a346e539c926
/vendors/Textpattern/Textfilter/Nl2Br.php: 
	00c2e5eb5bf332688a9c50f4e5ed73f1
/vendors/Textpattern/Textfilter/Plain.php: 
	e3c7f63b9a1940cc798855b9967f23de
/vendors/Textpattern/Textfilter/Registry.php: 
	4170a43b7973f1120de914a3fc0576fb
/vendors/Textpattern/Textfilter/TextfilterInterface.php: 
	30811632e0c2f491726995e95c579087
/vendors/Textpattern/Textfilter/Textile.php: 
	082ebbdb2f7a49fdb9765c4c6d2f5ef9
/vendors/Textpattern/Textile/Parser.php: 
	9d949632792c6b4d06989d9e2850744f
/vendors/Textpattern/Textpack/Parser.php: 
	2a1f718b9b11e97086161060c8e76b17
/vendors/Textpattern/Textpack/String/Iterator.php: 
	135cf5d86e191bae3139703c51cdc217
/vendors/Textpattern/Textpack/StringInterface.php: 
	b6cc517b7ec5f0e1995916878d5ee358
/vendors/Textpattern/Type/StringType.php: 
	c322366173b359c6d14223eee5b425bc
/vendors/Textpattern/Type/TypeCallable.php: 
	af1e2c7330803292e81aec97a198a373
/vendors/Textpattern/Type/TypeInterface.php: 
	b1b40316a4aaa7fc99f43078f215ab16
/vendors/Textpattern/Validator/BlankConstraint.php: 
	fa03c1d5576cbb03d62113e84617016b
/vendors/Textpattern/Validator/CategoryConstraint.php: 
	7983c8612d3289f20ee02c07657102e3
/vendors/Textpattern/Validator/ChoiceConstraint.php: 
	3308767c97cfb14f608a01d7583c79a6
/vendors/Textpattern/Validator/Constraint.php: 
	ac476eae8cd4acbf30b1f1ed80f59240
/vendors/Textpattern/Validator/FalseConstraint.php: 
	fa81622e336dc47e5706c860983fe79a
/vendors/Textpattern/Validator/FormConstraint.php: 
	8f5c5ececcc8b9b45ab9d237f1d1ba60
/vendors/Textpattern/Validator/SectionConstraint.php: 
	18a6828594b47798bf7db56f9e01c40c
/vendors/Textpattern/Validator/TrueConstraint.php: 
	415c2ec0adc2a37b0c9bfb82af66b000
/vendors/Textpattern/Validator/Validator.php: 
	ff06c7f8ccdc75c195c8cc38c624ea0f
/vendors/Txp.php: 
	3cbca9376577717d0a4cfc80903013ff

------------------------

Last edited by whocarez (2017-07-15 18:15:52)

Offline

#3 2017-07-15 18:20:46

whocarez
Plugin Author
From: Germany/Ukraine
Registered: 2007-10-08
Posts: 223
Website

Re: strange behaviour of plugin after update to 4.6.2

I switched also this plugin off and put

<txp:php>echo "Query: " . $_SERVER['QUERY_STRING'];</txp:php>

in the article default form.

Output is: Query: $1

Last edited by whocarez (2017-07-17 07:59:33)

Offline

#4 2017-07-23 09:19:47

whocarez
Plugin Author
From: Germany/Ukraine
Registered: 2007-10-08
Posts: 223
Website

Re: strange behaviour of plugin after update to 4.6.2

It turned out, that it was a configuration problem in my test environment with Lighttpd and the 404 error handling for clean urls.

Somehow I had server.error-handler-404 set to "/index.php?$1" instead of "/index.php", so that’s why I got these strange $1 queries.

After setting it right, the problem is gone.

Offline

Board footer

Powered by FluxBB