Skip to main content
edited tags
Link
avpaderno
  • 97.9k
  • 15
  • 164
  • 284
Bounty Ended with no winning answer by CommunityBot
added 185 characters in body; edited tags; added 40 characters in body
Source Link
Tivie
  • 305
  • 3
  • 17

I also created a test.php, located at mydomain.com/test/test.php for testing purposes with this line <?php print function drapps_shortlinks_createlink($url, TRUE, FALSE); ?> and changedEDIT: This function is called in Drupal's node-news.tpl.php inserting the same line in a div (also for testing purposes)like this:

...
<div class="test"><?php print drapps_shortlinks_createlink($url, TRUE, FALSE); ?></div>
...

test.
Whenphp

<?php

$path = "path/to/drupal"; //changed for security reasons

include_once($path . 'sites/all/modules/drapps_shortlinks/drapps_shortlinks.inc');

$url = 'http://www.google.com/';

print drapps_shortlinks_createlink($url, TRUE, FALSE);

?>

When I go to http://www.mydomain.com/test/test.php, the script works fine and I get an 'ok' response from google; a short link is created and it works fine. When I navigate to a news node, the script runs OK, but Google responds with a 403 (forbidden) error.

I also created a test.php, located at mydomain.com/test/test.php for testing purposes with this line <?php print function drapps_shortlinks_createlink($url, TRUE, FALSE); ?> and changed node-news.tpl.php inserting the same line in a div (also for testing purposes).
When I go to http://www.mydomain.com/test/test.php, the script works fine and I get an 'ok' response from google; a short link is created and it works fine. When I navigate to a news node, the script runs OK, but Google responds with a 403 (forbidden) error.

EDIT: This function is called in Drupal's node-news.tpl.php like this:

...
<div class="test"><?php print drapps_shortlinks_createlink($url, TRUE, FALSE); ?></div>
...

test.php

<?php

$path = "path/to/drupal"; //changed for security reasons

include_once($path . 'sites/all/modules/drapps_shortlinks/drapps_shortlinks.inc');

$url = 'http://www.google.com/';

print drapps_shortlinks_createlink($url, TRUE, FALSE);

?>

When I go to http://www.mydomain.com/test/test.php, the script works fine and I get an 'ok' response from google; a short link is created and it works fine. When I navigate to a news node, the script runs OK, but Google responds with a 403 (forbidden) error.

added 428 characters in body
Source Link
Tivie
  • 305
  • 3
  • 17

EDIT_1: THIS SCRIPT WORKS. So i think I can safely assume that the reson behind this has something to do with drupal rather than the script itself.

EDIT_2: I think the real question behind this is: What reasons could make a script behave differently when called from drupal? Any input will be appreciated: brainstorming, ideas, tips, troubleshooting methods, anything you think that might help, I will really appreciate it.

EDIT_1: THIS SCRIPT WORKS. So i think I can safely assume that the reson behind this has something to do with drupal rather than the script itself.

EDIT_2: I think the real question behind this is: What reasons could make a script behave differently when called from drupal? Any input will be appreciated: brainstorming, ideas, tips, troubleshooting methods, anything you think that might help, I will really appreciate it.

Bounty Started worth 100 reputation by Tivie
deleted 624 characters in body; edited tags
Source Link
avpaderno
  • 97.9k
  • 15
  • 164
  • 284
Loading
added 2 characters in body
Source Link
Tivie
  • 305
  • 3
  • 17
Loading
deleted 605 characters in body
Source Link
Tivie
  • 305
  • 3
  • 17
Loading
Tweeted twitter.com/#!/StackDrupal/status/72409544499793920
deleted 2 characters in body
Source Link
Tivie
  • 305
  • 3
  • 17
Loading
Source Link
Tivie
  • 305
  • 3
  • 17
Loading