Opened 18 years ago
Closed 18 years ago
#4820 closed defect (bug) (fixed)
Regex fix for $pagelinkedfrom (xmlrpc.php)
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | 2.3 | Priority: | high |
Severity: | normal | Version: | 2.3 |
Component: | XML-RPC | Keywords: | has-patch |
Focuses: | Cc: |
Description
xmlrpc.php line 1937:
$pagelinkedfrom = preg_replace('#&([^amp\;])#is', '&$1', $pagelinkedfrom);
doesn't seem to work like it was intended.
It should be something like:
$pagelinkedfrom = preg_replace('#amp;#is', '&', $pagelinkedfrom); $pagelinkedfrom = preg_replace('#&(.)#is', '&$1', $pagelinkedfrom);
Attachments (1)
Change History (7)
#3
@
18 years ago
It looks like your first item:
$pagelinkedfrom = preg_replace('#&#is', '&', $pagelinkedfrom);
is already being done on 1810 using str_replace:
$pagelinkedfrom = str_replace('&', '&', $pagelinkedfrom);
Is there a specific example of where the current code doesn't work as expected?
#4
@
18 years ago
- Keywords has-patch added
I found another one to fix. Please see the attachment.
Is there a specific example of where the current code doesn't work as expected?
Yes. The current code contains a misuse of character class (Square brackets).
Example:
$pagelinkedfrom = '&a=1&m=2&p=3&ok=4&'; $pagelinkedfrom = preg_replace('#&([^amp\;])#is', '&$1', $pagelinkedfrom); echo $pagelinkedfrom; // result is &a=1&m=2&p=3&ok=4&
Note: See
TracTickets for help on using
tickets.