Static Page: Link "bugged" ?

If you have stumble upon problems, or wish to ask a question about RecordPress, this is the right place!

Static Page: Link "bugged" ?

Postby Jessica » Tue Oct 27, 2009 6:14 am

I don't know if it's a "true" bug... I've got a problem when I add a link in content of a static page

For exemple, code source is right at control panel like...
Code: Select all
<a href="http://www.recordpress.org">Record Press</a>


But, at the public side there is...
Code: Select all
<a href=\"http://www.recordpress.org\">Record Press</a>


Then, this link is broken

NB: 0.3.1 Version
Jessica
 
Posts: 12
Joined: Sun Oct 18, 2009 7:23 pm

Re: Static Page: Link "bugged" ?

Postby Jessica » Tue Oct 27, 2009 6:24 am

It's strange ;-)) I don't notice that... at your home-page !
your link to this Record Press Web-Site from your "startpage" of Bocken Records is correct...

Code: Select all
<p>Welcome to Bocken Records and be shure to check out the <a href="http://www.recordpress.org/" target="_blank" title="Visit the RecordPress project homepage">RecordPress projects</a> own home!</p>
Jessica
 
Posts: 12
Joined: Sun Oct 18, 2009 7:23 pm

Re: Static Page: Link "bugged" ?

Postby johan » Tue Oct 27, 2009 5:16 pm

This is because the server configuration have magic_qoutes set to on. In my server it's set to off.

So I have attached a fix you can try out (make backup of your existing file in case of) or if you feel handy open the file: rp-pageslinks-add.php in the admin folder.

Near top of this document you find the following code:
Code: Select all
      $stmt = $db->prepare("INSERT INTO rp_links(header, linkorder, url, title, target)VALUES(?, ?, ?, ?, ?)");
      $stmt->bindValue(1, $_POST['f1'], PDO::PARAM_STR);
      $stmt->bindValue(2, $_POST['f5'], PDO::PARAM_STR);
      $stmt->bindValue(3, $_POST['f2'], PDO::PARAM_STR);
      $stmt->bindValue(4, $_POST['f3'], PDO::PARAM_STR);
      $stmt->bindValue(5, $_POST['f4'], PDO::PARAM_STR);
      $stmt->execute(array($_POST['f1'], $_POST['f5'], $_POST['f2'], $_POST['f3'], $_POST['f4']));



Replace like this (take notice of the new stripslashes):

Code: Select all
      $stmt = $db->prepare("INSERT INTO rp_links(header, linkorder, url, title, target)VALUES(?, ?, ?, ?, ?)");
      $stmt->bindValue(1, $_POST['f1'], PDO::PARAM_STR);
      $stmt->bindValue(2, $_POST['f5'], PDO::PARAM_STR);
      $stmt->bindValue(3, stripslashes($_POST['f2']), PDO::PARAM_STR);
      $stmt->bindValue(4, $_POST['f3'], PDO::PARAM_STR);
      $stmt->bindValue(5, $_POST['f4'], PDO::PARAM_STR);
      $stmt->execute(array($_POST['f1'], $_POST['f5'], stripslashes($_POST['f2']), $_POST['f3'], $_POST['f4']));


See if this works for you! :) Thank you for the feedback! It's important for you, me, existing and future users!

EDIT: You need to delete and create the new link again.
EDIT 2: If this works I need to fix the rp-pageslinks-edit.php file as well!
Attachments
rp-pageslinks-add.php.zip
(1.88 KiB) Downloaded 79 times
Forum administrator and founder of the RecordPress project!
johan
Site Admin
 
Posts: 24
Joined: Mon Jan 26, 2009 6:47 pm


Return to Support

Who is online

Users browsing this forum: No registered users and 1 guest

cron