Ok nailed it:
<?php
/* Plugin Name: zzz-disable-opengraph */
if( multi_strpos($_SERVER[ 'SCRIPT_FILENAME'], array('myscript.php', 'domain.com/folder/')) !== false ) {
add_filter("fb_og_enabled", function($enabled){ enabled = false; }, 10, 1 );
}
/**
* Multi string position detection. Returns the first position of $check found in
* $str or an associative array of all found positions if $getResults is enabled.
*
* Always returns boolean false if no matches are found.
*
* @param string $str The string to search
* @param string|array $check String literal / array of strings to check
* @param boolean $getResults Return associative array of positions?
* @return boolean|int|array False if no matches, int|array otherwise
*/
function multi_strpos($string, $check, $getResults = false)
{
$result = array();
$check = (array) $check;
foreach ($check as $s)
{
$pos = strpos($string, $s);
if ($pos !== false)
{
if ($getResults)
{
$result[$s] = $pos;
}
else
{
return $pos;
}
}
}
return empty($result) ? false : $result;