18.06.2006, 14:33
|
#11 (permalink)
| | PostRank: 2
Registriert seit: 27.02.2006
Beiträge: 71
| Erstmal Monika abfrühstücken... *g* Zitat: |
Zitat von Monika naja ich nehm ein der alte treue Indianer (Apache der Server) versteht eben dieses neumoderne Zeuchs ohne index.php nicht,
davon kann ich mehr als ein Lied singen
ich sah auf Deinem Blog trackbacks, | Jupp, Trackbacks sind ja auch was anderes. Zitat: |
Zitat von Monika jetzt beginne ich zu fragen:
was verstehst Du unter: permalinks auf *standard* setzen, dann funktioniert es | Wie Webrocker schon sagte: Artikel- URL: ... /?p=123 Zitat: |
Zitat von Monika wieso sollte Dich jemand anpingen , wenn er keinen Link in seinem Artikel zu Dir setzt?
also all diese Pings ohne Link im Artikel nimmt Spam Karma 2 bei mir nicht an,
lg | Genau da ist das Problem. Wenn mich jemand verlinkt, kommt kein Ping an - erst wenn meine URL explizit im ACP unter Trackbacks eingetragen wird, erst dann kommt ein Trackback an, werde ich "nur" verlinkt, kommt eben kein Pingback an.
Ich hoffe, ich hab mich jetzt klarer ausgedrückt.
@Webrocker:
Super, nur verstehe ich kaum was davon. Vielleicht kommt ja noch ein Profi dazu. Aber Danke für Deinen Einsatz.
LG
Chris |
| |
18.06.2006, 16:01
|
#12 (permalink)
| | PostRank: 2
Registriert seit: 30.12.2005
Beiträge: 90
| Ja... profi to the rescue. 
Ich komme auch nicht mehr weiter. Ich habe in der xmlrpc.php die Bedingung mit dem '#p/...' mal geändert auf '#/p/...', danach war im Log nichts mehr mit output:... zu sehen  |
| |
18.06.2006, 16:22
|
#13 (permalink)
| | PostRank: 2
Registriert seit: 27.02.2006
Beiträge: 71
| Ich komme mit der Datei gar nicht klar. Was mich allerdings wundert, dass das Problem bisher noch niemandem aufgefallen ist, oder nur bei uns auftritt, ich gehe aber erstmal bis zum Beweis des Gegenteils von ersteren aus.
Schönen Sonntag Dir noch.
Chris |
| |
18.06.2006, 16:53
|
#14 (permalink)
| | PostRank: 2
Registriert seit: 30.12.2005
Beiträge: 90
| Um den Profis die Arbeit etwas zu erleichtern...
es gibt zwei Funktionen, die (anscheinend) damit zu tun haben.
Die eine lebt in /wp-includes/functions.php Zeile 178ff: PHP-Code: // examine a url (supposedly from this blog) and try to // determine the post ID it represents. function url_to_postid($url) { global $wp_rewrite;
// First, check to see if there is a 'p=N' or 'page_id=N' to match against preg_match('#[?&](p|page_id)=(\d+)#', $url, $values); $id = intval($values[2]); if ( $id ) return $id;
// Check to see if we are using rewrite rules $rewrite = $wp_rewrite->wp_rewrite_rules();
// Not using rewrite rules, and 'p=N' and 'page_id=N' methods failed, so we're out of options if ( empty($rewrite) ) return 0;
// $url cleanup by Mark Jaquith // This fixes things like #anchors, ?query=strings, missing 'www.', // added 'www.', or added 'index.php/' that will mess up our WP_Query // and return a false negative
// Get rid of the #anchor $url_split = explode('#', $url); $url = $url_split[0];
// Get rid of URI ?query=string $url_split = explode('?', $url); $url = $url_split[0];
// Add 'www.' if it is absent and should be there if ( false !== strpos(get_settings('home'), '://www.') && false === strpos($url, '://www.') ) $url = str_replace('://', '://www.', $url);
// Strip 'www.' if it is present and shouldn't be if ( false === strpos(get_settings('home'), '://www.') ) $url = str_replace('://www.', '://', $url);
// Strip 'index.php/' if we're not using path info permalinks if ( false === strpos($rewrite, 'index.php/') ) $url = str_replace('index.php/', '', $url);
if ( false !== strpos($url, get_settings('home')) ) { // Chop off http://domain.com $url = str_replace(get_settings('home'), '', $url); } else { // Chop off /path/to/blog $home_path = parse_url(get_settings('home')); $home_path = $home_path['path']; $url = str_replace($home_path, '', $url); }
// Trim leading and lagging slashes $url = trim($url, '/');
$request = $url;
// Done with cleanup
// Look for matches. $request_match = $request; foreach ($rewrite as $match => $query) { // If the requesting file is the anchor of the match, prepend it // to the path info. if ( (! empty($url)) && (strpos($match, $url) === 0) ) { $request_match = $url . '/' . $request; }
if ( preg_match("!^$match!", $request_match, $matches) ) { // Got a match. // Trim the query of everything up to the '?'. $query = preg_replace("!^.+\?!", '', $query);
// Substitute the substring matches into the query. eval("\$query = \"$query\";"); $query = new WP_Query($query); if ( $query->is_single || $query->is_page ) return $query->post->ID; else return 0; } } return 0; }
Die andere wohnt in der xmlrpc.php selbst, Zeile 1083ff: PHP-Code: /* PingBack functions * specs on www.hixie.ch/specs/pingback/pingback */
/* pingback.ping gets a pingback and registers it */ function pingback_ping($args) { global $wpdb, $wp_version;
$this->escape($args);
$pagelinkedfrom = $args[0]; $pagelinkedto = $args[1];
$title = '';
$pagelinkedfrom = str_replace('&', '&', $pagelinkedfrom); $pagelinkedto = preg_replace('#&([^amp\;])#is', '&$1', $pagelinkedto);
$error_code = -1;
// Check if the page linked to is in our site $pos1 = strpos($pagelinkedto, str_replace(array('http://www.','http://','https://www.','https://'), '', get_settings('home'))); if( !$pos1 ) return new IXR_Error(0, 'Is there no link to us?');
// let's find which post is linked to // FIXME: does url_to_postid() cover all these cases already? // if so, then let's use it and drop the old code. $urltest = parse_url($pagelinkedto); if ($post_ID = url_to_postid($pagelinkedto)) { $way = 'url_to_postid()'; } elseif (preg_match('#p/[0-9]{1,}#', $urltest['path'], $match)) { // the path defines the post_ID (archives/p/XXXX) $blah = explode('/', $match[0]); $post_ID = $blah[1]; $way = 'from the path'; } elseif (preg_match('#p=[0-9]{1,}#', $urltest['query'], $match)) { // the querystring defines the post_ID (?p=XXXX) $blah = explode('=', $match[0]); $post_ID = $blah[1]; $way = 'from the querystring'; } elseif (isset($urltest['fragment'])) { // an #anchor is there, it's either... if (intval($urltest['fragment'])) { // ...an integer #XXXX (simpliest case) $post_ID = $urltest['fragment']; $way = 'from the fragment (numeric)'; } elseif (preg_match('/post-[0-9]+/',$urltest['fragment'])) { // ...a post id in the form 'post-###' $post_ID = preg_replace('/[^0-9]+/', '', $urltest['fragment']); $way = 'from the fragment (post-###)'; } elseif (is_string($urltest['fragment'])) { // ...or a string #title, a little more complicated $title = preg_replace('/[^a-z0-9]/i', '.', $urltest['fragment']); $sql = "SELECT ID FROM $wpdb->posts WHERE post_title RLIKE '$title'"; if (! ($post_ID = $wpdb->get_var($sql)) ) { // returning unknown error '0' is better than die()ing return new IXR_Error(0, ''); } $way = 'from the fragment (title)'; } } else { // TODO: Attempt to extract a post ID from the given URL return new IXR_Error(33, 'The specified target URI cannot be used as a target. It either doesn\'t exist, or it is not a pingback-enabled resource.'); }
Wenn ich das richtig interpretiere, müsste eine url wie Code: http://www.domain.tld/wp/index.php/2006/03/10/mein-toller-titel/ Im unteren Bereich der xmlrpc Funktion landen, dort, wo die DB-Query mit dem "RLIKE $title" steht.
Aber irgendwas geht da schief.
Geändert von Webrocker (18.06.2006 um 16:56 Uhr).
|
| |
18.06.2006, 18:09
|
#15 (permalink)
| | PostRank: 2
Registriert seit: 30.12.2005
Beiträge: 90
| Ok, ich habe den Fehler gefunden, bzw eingekreist.
Der Abschnitt mit "index.php/" in der functions.php, Zeile 216 PHP-Code: // Strip 'index.php/' if we're not using path info permalinks if ( false === strpos($rewrite, 'index.php/') ) $url = str_replace('index.php/', '', $url);
ist der Bösewicht. Wenn ich die beiden Zeilen auskommentiere, klappt es mit den Pingbacks.
Anscheinend ist die if-Abfrage fehlerhaft, sodass *immer* das index.php aus dem zu checkenden url-String entfernt wird. |
| |
18.06.2006, 18:13
|
#16 (permalink)
| | PostRank: 2
Registriert seit: 27.02.2006
Beiträge: 71
| Du bist genial, sag doch, dass Du der Profi bist.
Ist die Funktion wichtig, oder kann man sie auskommentieren? *g*
Chris |
| |
18.06.2006, 18:33
|
#17 (permalink)
| | PostRank: 2
Registriert seit: 30.12.2005
Beiträge: 90
| Zitat: |
Zitat von Chris_ oder kann man sie auskommentieren? | Ich habe es bei mir jetzt mal auskommentiert. Mal schauen, ob alles so funktioniert, wie bisher.
Vielleicht hat jemand von PHP mehr Ahnung als ich und kann die if-Abfrage richtig machen. Die Idee dahinter ist ja richtig, nur ist das kein String, sondern ein (indiziertes) Array: PHP-Code: Array ( [index.php/(tags-durchsuchen)/trackback/?$] => index.php?pagename=$matches[1]&tb=1 [index.php/(tags-durchsuchen)/feed/(feed|rdf|rss|rss2|atom)/?$] => index.php?pagename=$matches[1]&feed=$matches[2] [index.php/(tags-durchsuchen)/(feed|rdf|rss|rss2|atom)/?$] => index.php?pagename=$matches[1]&feed=$matches[2] [index.php/(tags-durchsuchen)/page/?([0-9]{1,})/?$] => index.php?pagename=$matches[1]&paged=$matches[2] [index.php/(tags-durchsuchen)(/[0-9]+)?/?$] => index.php?pagename=$matches[1]&page=$matches[2] [index.php/tags-durchsuchen/attachment/([^/]+)/?$] => index.php?attachment=$matches[1] [index.php/tags-durchsuchen/attachment/([^/]+)/trackback/?$] => index.php?attachment=$matches[1]&tb=1 [index.php/tags-durchsuchen/attachment/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$] => index.php?attachment=$matches[1]&feed=$matches[2] [index.php/tags-durchsuchen/attachment/([^/]+)/(feed|rdf|rss|rss2|atom)/?$] => index.php?attachment=$matches[1]&feed=$matches[2] [index.php/(kontakt)/trackback/?$] => index.php?pagename=$matches[1]&tb=1 [index.php/(kontakt)/feed/(feed|rdf|rss|rss2|atom)/?$] => index.php?pagename=$matches[1]&feed=$matches[2] [index.php/(kontakt)/(feed|rdf|rss|rss2|atom)/?$] => index.php?pagename=$matches[1]&feed=$matches[2] [index.php/(kontakt)/page/?([0-9]{1,})/?$] => index.php?pagename=$matches[1]&paged=$matches[2] [index.php/(kontakt)(/[0-9]+)?/?$] => index.php?pagename=$matches[1]&page=$matches[2] [index.php/kontakt/attachment/([^/]+)/?$] => index.php?attachment=$matches[1] [index.php/kontakt/attachment/([^/]+)/trackback/?$] => index.php?attachment=$matches[1]&tb=1 [index.php/kontakt/attachment/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$] => index.php?attachment=$matches[1]&feed=$matches[2] [index.php/kontakt/attachment/([^/]+)/(feed|rdf|rss|rss2|atom)/?$] => index.php?attachment=$matches[1]&feed=$matches[2] [index.php/feed/(feed|rdf|rss|rss2|atom)/?$] => index.php?&feed=$matches[1] [index.php/(feed|rdf|rss|rss2|atom)/?$] => index.php?&feed=$matches[1] [index.php/page/?([0-9]{1,})/?$] => index.php?&paged=$matches[1] [index.php/comments/feed/(feed|rdf|rss|rss2|atom)/?$] => index.php?&feed=$matches[1]&withcomments=1 [index.php/comments/(feed|rdf|rss|rss2|atom)/?$] => index.php?&feed=$matches[1]&withcomments=1 [index.php/comments/page/?([0-9]{1,})/?$] => index.php?&paged=$matches[1] [index.php/search/(.+)/feed/(feed|rdf|rss|rss2|atom)/?$] => index.php?s=$matches[1]&feed=$matches[2] [index.php/search/(.+)/(feed|rdf|rss|rss2|atom)/?$] => index.php?s=$matches[1]&feed=$matches[2] [index.php/search/(.+)/page/?([0-9]{1,})/?$] => index.php?s=$matches[1]&paged=$matches[2] [index.php/search/(.+)/?$] => index.php?s=$matches[1] [index.php/category/(.+?)/feed/(feed|rdf|rss|rss2|atom)/?$] => index.php?category_name=$matches[1]&feed=$matches[2] [index.php/category/(.+?)/(feed|rdf|rss|rss2|atom)/?$] => index.php?category_name=$matches[1]&feed=$matches[2] [index.php/category/(.+?)/page/?([0-9]{1,})/?$] => index.php?category_name=$matches[1]&paged=$matches[2] [index.php/category/(.+?)/?$] => index.php?category_name=$matches[1] [index.php/author/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$] => index.php?author_name=$matches[1]&feed=$matches[2] [index.php/author/([^/]+)/(feed|rdf|rss|rss2|atom)/?$] => index.php?author_name=$matches[1]&feed=$matches[2] [index.php/author/([^/]+)/page/?([0-9]{1,})/?$] => index.php?author_name=$matches[1]&paged=$matches[2] [index.php/author/([^/]+)/?$] => index.php?author_name=$matches[1] [index.php/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/feed/(feed|rdf|rss|rss2|atom)/?$] => index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&feed=$matches[4] [index.php/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/(feed|rdf|rss|rss2|atom)/?$] => index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&feed=$matches[4] [index.php/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/page/?([0-9]{1,})/?$] => index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&paged=$matches[4] [index.php/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/?$] => index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3] [index.php/([0-9]{4})/([0-9]{1,2})/feed/(feed|rdf|rss|rss2|atom)/?$] => index.php?year=$matches[1]&monthnum=$matches[2]&feed=$matches[3] [index.php/([0-9]{4})/([0-9]{1,2})/(feed|rdf|rss|rss2|atom)/?$] => index.php?year=$matches[1]&monthnum=$matches[2]&feed=$matches[3] [index.php/([0-9]{4})/([0-9]{1,2})/page/?([0-9]{1,})/?$] => index.php?year=$matches[1]&monthnum=$matches[2]&paged=$matches[3] [index.php/([0-9]{4})/([0-9]{1,2})/?$] => index.php?year=$matches[1]&monthnum=$matches[2] [index.php/([0-9]{4})/feed/(feed|rdf|rss|rss2|atom)/?$] => index.php?year=$matches[1]&feed=$matches[2] [index.php/([0-9]{4})/(feed|rdf|rss|rss2|atom)/?$] => index.php?year=$matches[1]&feed=$matches[2] [index.php/([0-9]{4})/page/?([0-9]{1,})/?$] => index.php?year=$matches[1]&paged=$matches[2] [index.php/([0-9]{4})/?$] => index.php?year=$matches[1] [index.php/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/([^/]+)/trackback/?$] => index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&name=$matches[4]&tb=1 [index.php/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$] => index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&name=$matches[4]&feed=$matches[5] [index.php/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/([^/]+)/(feed|rdf|rss|rss2|atom)/?$] => index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&name=$matches[4]&feed=$matches[5] [index.php/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/([^/]+)/page/?([0-9]{1,})/?$] => index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&name=$matches[4]&paged=$matches[5] [index.php/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/([^/]+)(/[0-9]+)?/?$] => index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&name=$matches[4]&page=$matches[5] [index.php/[0-9]{4}/[0-9]{1,2}/[0-9]{1,2}/[^/]+/([^/]+)/?$] => index.php?attachment=$matches[1] [index.php/[0-9]{4}/[0-9]{1,2}/[0-9]{1,2}/[^/]+/([^/]+)/trackback/?$] => index.php?attachment=$matches[1]&tb=1 [index.php/[0-9]{4}/[0-9]{1,2}/[0-9]{1,2}/[^/]+/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$] => index.php?attachment=$matches[1]&feed=$matches[2] [index.php/[0-9]{4}/[0-9]{1,2}/[0-9]{1,2}/[^/]+/([^/]+)/(feed|rdf|rss|rss2|atom)/?$] => index.php?attachment=$matches[1]&feed=$matches[2] [index.php/[0-9]{4}/[0-9]{1,2}/[0-9]{1,2}/[^/]+/attachment/([^/]+)/?$] => index.php?attachment=$matches[1] [index.php/[0-9]{4}/[0-9]{1,2}/[0-9]{1,2}/[^/]+/attachment/([^/]+)/trackback/?$] => index.php?attachment=$matches[1]&tb=1 [index.php/[0-9]{4}/[0-9]{1,2}/[0-9]{1,2}/[^/]+/attachment/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$] => index.php?attachment=$matches[1]&feed=$matches[2] [index.php/[0-9]{4}/[0-9]{1,2}/[0-9]{1,2}/[^/]+/attachment/([^/]+)/(feed|rdf|rss|rss2|atom)/?$] => index.php?attachment=$matches[1]&feed=$matches[2] [index.php/tag/(.*)/feed/(feed|rdf|rss|rss2|atom)/?$] => index.php?tag=$matches[1]&feed=$matches[2] [index.php/tag/(.*)/(feed|rdf|rss|rss2|atom)/?$] => index.php?tag=$matches[1]&feed=$matches[2] [index.php/tag/(.*)/page/?([0-9]{1,})/?$] => index.php?tag=$matches[1]&paged=$matches[2] [index.php/tag/(.*)/?$] => index.php?tag=$matches[1] )
Der check in der if-Abfrage müsste also auf die keys in diesem Array gehen, evtl genügt ein check auf den ersten Key, ob dieser "index.php/" enthält.
Also, bitte jemand mit php-Ahnung hier einsteigen.
Falls wir hier einen echten Bug gefunden haben, wie erfahren die WP-Entwickler davon?
Gruss
Tom |
| |
18.06.2006, 19:41
|
#18 (permalink)
| | PostRank: 2
Registriert seit: 30.12.2005
Beiträge: 90
| Zitat: |
Zitat von Webrocker Der check in der if-Abfrage müsste also auf die keys in diesem Array gehen, evtl genügt ein check auf den ersten Key, ob dieser "index.php/" enthält. | So, muss man denn alles selbst machen....  .
Anstelle von PHP-Code: if ( false === strpos($rewrite, 'index.php/') )
habe ich jetzt PHP-Code: if ( false === strpos(key($rewrite), 'index.php/') )
stehen, und Pingbacks kommen an. Damit wird geprüft, ob im ersten Key des rewrite-rules Arrays "index.php/" vorkommt, wenn nicht, wird "index.php/" wie zuvor entfernt. Wenn man es ganz genau nimmt, müsste man das rewrite-rules Array durchnudeln, und schauen, ob in irgendeinem Key das "index.php/" steht. Da aber wie oben zu sehen ist, in jeder Zeile des Arrays das "index.php/" vorkommt, genügt es, nur in der ersten zu schauen. Denke ich mal. |
| |
18.06.2006, 19:45
|
#19 (permalink)
| | PostRank: 2
Registriert seit: 27.02.2006
Beiträge: 71
| THX a lot.
Chris |
| |
18.06.2006, 20:08
|
#20 (permalink)
| | PostRank: 2
Registriert seit: 27.02.2006
Beiträge: 71
| Es ist zum Mäuse melken... Bei mir funktioniert es weder mit Änderung der Coezeile noch mit Auskommentieren beider Zeilen...
Naja, kann man wohl nichts machen...
Chris |
| | | Themen-Optionen | | | | Ansicht | Linear-Darstellung |
Forumregeln
| Es ist dir nicht erlaubt, neue Themen zu verfassen. Es ist dir nicht erlaubt, auf Beiträge zu antworten. Es ist dir nicht erlaubt, Anhänge hochzuladen. Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten. HTML-Code ist aus. | | | Alle Zeitangaben in WEZ +1. Es ist jetzt 00:11 Uhr. | |