Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
& and # goes bonkers in my plugin
I am doing a plugin that uses regex’s. In it I search for <code>&#</code> but when I upload it to my server instead of thoose two chars I get a nice square (meaning a char that is not in the typeface). I’ve tried different things to get this through but nothing helps. And since it is a regex I can’t add a space or something in between, there need not to be one. When I tried “just to see what happens” if I do add a space inbetween they render fine in the plugin code when it is installed. Argh!
Help!! cried the little plugin developer.
Last edited by obeewan (2004-09-01 23:39:35)
Plugins:
ob1_advanced_search 1.032b, ob1_search_score 1.0, ob1_pagination 2.5, ob1_title 4.1, ob1_modified 2.1
“Let your plans be dark and as impenetratable as night, and when you move, fall like a thunderbolt.”
— Sun Tzu
Offline
#2 2004-09-01 23:45:38
- zem
- Developer Emeritus
- From: Melbourne, Australia
- Registered: 2004-04-08
- Posts: 2,579
Re: & and # goes bonkers in my plugin
Are you editing your plugin via the Textpattern admin interface? It seems to mess up encoding.
Alex
Offline
Re: & and # goes bonkers in my plugin
No, I’ve compiled it and then when I install it outputs (in the admin interface) a square instead of <code>&#</code>.
Last edited by obeewan (2004-09-01 23:49:40)
Plugins:
ob1_advanced_search 1.032b, ob1_search_score 1.0, ob1_pagination 2.5, ob1_title 4.1, ob1_modified 2.1
“Let your plans be dark and as impenetratable as night, and when you move, fall like a thunderbolt.”
— Sun Tzu
Offline
Re: & and # goes bonkers in my plugin
Try this function and encode it and upload it and see what you get:
<code>
function testfunction() {
$pattern = “/(&#(\\d+);)/e”;
}
</code>
Because this is what I get:
<code>
$pattern = “/(�(\\d+);)/e”;
</code>
Last edited by obeewan (2004-09-01 23:50:42)
Plugins:
ob1_advanced_search 1.032b, ob1_search_score 1.0, ob1_pagination 2.5, ob1_title 4.1, ob1_modified 2.1
“Let your plans be dark and as impenetratable as night, and when you move, fall like a thunderbolt.”
— Sun Tzu
Offline
Re: & and # goes bonkers in my plugin
Hmmm .. Even if I cut and paste into the admin when I save it goes ape again.
Plugins:
ob1_advanced_search 1.032b, ob1_search_score 1.0, ob1_pagination 2.5, ob1_title 4.1, ob1_modified 2.1
“Let your plans be dark and as impenetratable as night, and when you move, fall like a thunderbolt.”
— Sun Tzu
Offline
Re: & and # goes bonkers in my plugin
Annoying. It works though it looks ape. (Ape is my new fav word it seems ;)
Plugins:
ob1_advanced_search 1.032b, ob1_search_score 1.0, ob1_pagination 2.5, ob1_title 4.1, ob1_modified 2.1
“Let your plans be dark and as impenetratable as night, and when you move, fall like a thunderbolt.”
— Sun Tzu
Offline
Pages: 1