bgarrels / textpattern

Automatically exported from code.google.com/p/textpattern
0 stars 0 forks source link

link_to_next/prev with sort="custom_1+0" and the likes #354

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. <txp:article sort="custom_1+0" /> followed by 
<txp:link_to_next><txp:next_title /></txp:link_to_next> in individual article 
view.

What is the expected output? What do you see instead?
Expected: link to the next article, ideally by custom_1 field, or at least by 
post date.
Observed: random link or no link at all, depending on custom_1 value.

What version of the product are you using? On what operating system?
Textpattern v 4.5.4

Please provide any additional information below.
The pattern '/[),]/' used by getNextPrev() function does not detect 
"custom_1+0" as a non-standard sort attribute. Replacing 

if (empty($m[0]) || count($m) > 2 || preg_match('/[),]/', $m[0]))

by

if (empty($m[0]) || count($m) > 2 || 
!preg_match('/^(?:[0-9,a-z,A-Z$_\x{0080}-\x{FFFF}]+|`[\x{0001}-\x{FFFF}]+`)$/u',
 $m[0]))

on line 231 of textpattern/lib/txplib_publish.php should fix the problem 
(quickly tested).

Original issue reported on code.google.com by haut.b...@aliceadsl.fr on 14 Jan 2013 at 7:16

GoogleCodeExporter commented 9 years ago

Original comment by r.wetzlmayr on 16 Jan 2013 at 9:15

GoogleCodeExporter commented 9 years ago

Original comment by r.wetzlmayr on 16 Feb 2013 at 7:26

GoogleCodeExporter commented 9 years ago
Related discussion: http://forum.textpattern.com/viewtopic.php?id=39202

Original comment by r.wetzlmayr on 1 Mar 2013 at 10:24

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r5370.

Original comment by r.wetzlmayr on 1 Mar 2013 at 10:26

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r5371.

Original comment by r.wetzlmayr on 1 Mar 2013 at 10:28